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 | 3c6a05803c8f33b2ce6f704df87c98983029befd (patch) | |
tree | 53ef642f8baac03fe0d8518bd263da3ded64987b /slirp/socket.c | |
parent | f3546deb079fd9e069870b9fd2f22bb48d5c8254 (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/socket.c')
-rw-r--r-- | slirp/socket.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/slirp/socket.c b/slirp/socket.c index 9f13f03cc6..936021e84d 100644 --- a/slirp/socket.c +++ b/slirp/socket.c @@ -586,17 +586,17 @@ sosendto(struct socket *so, struct mbuf *m) } /* - * XXX This should really be tcp_listen + * Listen for incoming TCP connections */ struct socket * -solisten(u_int port, u_int32_t laddr, u_int lport, int flags) +tcp_listen(u_int32_t haddr, u_int hport, u_int32_t laddr, u_int lport, int flags) { struct sockaddr_in addr; struct socket *so; int s, opt = 1; socklen_t addrlen = sizeof(addr); - DEBUG_CALL("solisten"); + DEBUG_CALL("tcp_listen"); DEBUG_ARG("port = %d", port); DEBUG_ARG("laddr = %x", laddr); DEBUG_ARG("lport = %d", lport); @@ -625,8 +625,8 @@ solisten(u_int port, u_int32_t laddr, u_int lport, int flags) so->so_laddr.s_addr = laddr; /* Ditto */ 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 (((s = socket(AF_INET,SOCK_STREAM,0)) < 0) || (setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(char *)&opt,sizeof(int)) < 0) || |