gnrc_sock_udp: use sock's local end-point for listening
Without this fix the listener doesn't actually listen on the (potentially) ephemeral port introduced in #9382, but on port 0 which is wrong.
This commit is contained in:
parent
904c583038
commit
cb74063573
@ -136,7 +136,7 @@ int sock_udp_create(sock_udp_t *sock, const sock_udp_ep_t *local,
|
|||||||
}
|
}
|
||||||
if (local != NULL) {
|
if (local != NULL) {
|
||||||
/* listen only with local given */
|
/* listen only with local given */
|
||||||
gnrc_sock_create(&sock->reg, GNRC_NETTYPE_UDP, local->port);
|
gnrc_sock_create(&sock->reg, GNRC_NETTYPE_UDP, sock->local.port);
|
||||||
}
|
}
|
||||||
sock->flags = flags;
|
sock->flags = flags;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user