modem: ublox-sara-r4: do not truncate outgoing datagrams
Do not truncate outgoing datagrams if they do not fit in maximum handled packet size. Set EMSGSIZE errno and return -1 instead. Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
This commit is contained in:
parent
ae587f8e50
commit
b27bf92234
|
@ -327,6 +327,11 @@ static ssize_t send_socket_data(void *obj,
|
|||
* the socket in one command
|
||||
*/
|
||||
if (buf_len > MDM_MAX_DATA_LENGTH) {
|
||||
if (sock->type == SOCK_DGRAM) {
|
||||
errno = EMSGSIZE;
|
||||
return -1;
|
||||
}
|
||||
|
||||
buf_len = MDM_MAX_DATA_LENGTH;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue