aboutsummaryrefslogtreecommitdiff
path: root/slirp/udp.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@web.de>2009-06-24 14:42:28 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-06-29 08:52:45 -0500
commit3c6a05803c8f33b2ce6f704df87c98983029befd (patch)
tree53ef642f8baac03fe0d8518bd263da3ded64987b /slirp/udp.c
parentf3546deb079fd9e069870b9fd2f22bb48d5c8254 (diff)
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 'slirp/udp.c')
-rw-r--r--slirp/udp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/slirp/udp.c b/slirp/udp.c
index ff3a39fb21..d675ad3e66 100644
--- a/slirp/udp.c
+++ b/slirp/udp.c
@@ -627,7 +627,8 @@ struct cu_header {
}
struct socket *
-udp_listen(u_int port, u_int32_t laddr, u_int lport, int flags)
+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;
@@ -642,8 +643,8 @@ 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);