aboutsummaryrefslogtreecommitdiff
path: root/udp.c
diff options
context:
space:
mode:
Diffstat (limited to 'udp.c')
-rw-r--r--udp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/udp.c b/udp.c
index 7bb7323..f1afbf5 100644
--- a/udp.c
+++ b/udp.c
@@ -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);