diff options
Diffstat (limited to 'udp.c')
-rw-r--r-- | udp.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -621,7 +621,8 @@ static void udp_emu(struct socket *so, struct mbuf *m) } } -struct socket *udp_listen(u_int port, u_int32_t laddr, u_int lport, int flags) +struct socket *udp_listen(u_int32_t haddr, u_int hport, u_int32_t laddr, + u_int lport, int flags) { struct sockaddr_in addr; struct socket *so; @@ -636,8 +637,8 @@ struct socket *udp_listen(u_int port, u_int32_t laddr, u_int lport, int flags) insque(so, &udb); addr.sin_family = AF_INET; - addr.sin_addr.s_addr = INADDR_ANY; - addr.sin_port = port; + addr.sin_addr.s_addr = haddr; + addr.sin_port = hport; if (bind(so->s, (struct sockaddr *)&addr, addrlen) < 0) { udp_detach(so); |