Skip to content

Commit b27bf92

Browse files
mniestrojcarlescufi
authored andcommitted
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 <[email protected]>
1 parent ae587f8 commit b27bf92

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/modem/ublox-sara-r4.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,11 @@ static ssize_t send_socket_data(void *obj,
327327
* the socket in one command
328328
*/
329329
if (buf_len > MDM_MAX_DATA_LENGTH) {
330+
if (sock->type == SOCK_DGRAM) {
331+
errno = EMSGSIZE;
332+
return -1;
333+
}
334+
330335
buf_len = MDM_MAX_DATA_LENGTH;
331336
}
332337

0 commit comments

Comments
 (0)