From 8211db64ae82dc52061a1fc1349993eec158ab61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Briano?= Date: Thu, 7 Apr 2016 10:37:30 -0300 Subject: [PATCH] Allow creating connections on unspecified local port If the given local port is 0, we get no replies. --- core/net/ip/simple-udp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/net/ip/simple-udp.c b/core/net/ip/simple-udp.c index 8ecd0aaa1..692fea19a 100644 --- a/core/net/ip/simple-udp.c +++ b/core/net/ip/simple-udp.c @@ -119,7 +119,7 @@ simple_udp_register(struct simple_udp_connection *c, PROCESS_CONTEXT_BEGIN(&simple_udp_process); c->udp_conn = udp_new(remote_addr, UIP_HTONS(remote_port), c); - if(c->udp_conn != NULL) { + if(c->udp_conn != NULL && local_port) { udp_bind(c->udp_conn, UIP_HTONS(local_port)); } PROCESS_CONTEXT_END();