net: sockets: Ignore error if there is none
Seen when having multiple network interfaces that the sock_error was 0 even if the socket was serviced properly. So if SO_ERROR returns 0, just ignore it. Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit is contained in:
parent
8e866e95c8
commit
11fae015e0
|
@ -140,9 +140,12 @@ static int recv_data(struct net_socket_service_event *pev)
|
|||
(pev->event.revents & ZSOCK_POLLNVAL)) {
|
||||
(void)zsock_getsockopt(pev->event.fd, SOL_SOCKET,
|
||||
SO_ERROR, &sock_error, &optlen);
|
||||
NET_ERR("Receiver IPv%d socket error (%d)",
|
||||
family == AF_INET ? 4 : 6, sock_error);
|
||||
ret = DNS_EAI_SYSTEM;
|
||||
if (sock_error > 0) {
|
||||
NET_ERR("Receiver IPv%d socket error (%d)",
|
||||
family == AF_INET ? 4 : 6, sock_error);
|
||||
ret = DNS_EAI_SYSTEM;
|
||||
}
|
||||
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue