Merge pull request #4468 from cgundogan/pr/posix_sockets/close_fd_fix
posix_sockets: fix overflowing fd in close()
This commit is contained in:
commit
c811380440
@ -56,6 +56,7 @@ void conn_udp_close(conn_udp_t *conn)
|
|||||||
assert(conn->l4_type == GNRC_NETTYPE_UDP);
|
assert(conn->l4_type == GNRC_NETTYPE_UDP);
|
||||||
if (conn->netreg_entry.pid != KERNEL_PID_UNDEF) {
|
if (conn->netreg_entry.pid != KERNEL_PID_UNDEF) {
|
||||||
gnrc_netreg_unregister(GNRC_NETTYPE_UDP, &conn->netreg_entry);
|
gnrc_netreg_unregister(GNRC_NETTYPE_UDP, &conn->netreg_entry);
|
||||||
|
conn->netreg_entry.pid = KERNEL_PID_UNDEF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -255,6 +255,7 @@ static int socket_close(int socket)
|
|||||||
res = -1;
|
res = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
res = -1;
|
res = -1;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user