Merge pull request #1589 from ibriano/master

Allow creating connections on unspecified local port
This commit is contained in:
Antonio Lignan 2016-06-14 21:30:34 +02:00 committed by GitHub
commit fa88122140

View File

@ -119,7 +119,7 @@ simple_udp_register(struct simple_udp_connection *c,
PROCESS_CONTEXT_BEGIN(&simple_udp_process); PROCESS_CONTEXT_BEGIN(&simple_udp_process);
c->udp_conn = udp_new(remote_addr, UIP_HTONS(remote_port), c); 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)); udp_bind(c->udp_conn, UIP_HTONS(local_port));
} }
PROCESS_CONTEXT_END(); PROCESS_CONTEXT_END();