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:
Martine Lenders 2018-06-28 17:22:35 +02:00
parent 904c583038
commit cb74063573

View File

@ -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;