diff options
author | Jan Kiszka <jan.kiszka@web.de> | 2009-06-24 14:42:28 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-06-29 08:52:45 -0500 |
commit | 8e75c14210d99e1c671c62c5aff6c5ea846eb9a1 (patch) | |
tree | 80e39781dc61632b3bd9ca30414372f2b8520c7a /udp.c | |
parent | cecc828f6d3ae7e430844a6f8dc6486f46a33cba (diff) | |
download | slirp-8e75c14210d99e1c671c62c5aff6c5ea846eb9a1.zip slirp-8e75c14210d99e1c671c62c5aff6c5ea846eb9a1.tar.gz slirp-8e75c14210d99e1c671c62c5aff6c5ea846eb9a1.tar.bz2 |
slirp: Bind support for host forwarding rules
Extend the hostfwd rule format so that the user can specify on which
host interface qemu should listen for incoming connections. If omitted,
binding will takes place against all interfaces.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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); |