driver: modem: ublox_sara_r4: fixed closing UDP socket

Following issue is addressed in this bugfix:

When using offloaded sockets with modem ublox_sara_r4,
the socket is only closed if it is in connected state
at the time of the function call. When using UDP sockets,
this leads to a socket never being closed.

Signed-off-by: Hans Wilmers <hans@wilmers.no>
This commit is contained in:
Hans Wilmers 2020-04-06 18:14:01 +02:00 committed by Jukka Rissanen
commit ed88088ba2

View file

@ -969,7 +969,7 @@ static int offload_close(struct modem_socket *sock)
return 0;
}
if (sock->is_connected) {
if (sock->is_connected || sock->ip_proto == IPPROTO_UDP) {
snprintk(buf, sizeof(buf), "AT+USOCL=%d", sock->id);
ret = modem_cmd_send(&mctx.iface, &mctx.cmd_handler,