[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-commits] [COMMIT 6dd5ffb] slirp: Explicitely mark host-forwarding
From: |
Anthony Liguori |
Subject: |
[Qemu-commits] [COMMIT 6dd5ffb] slirp: Explicitely mark host-forwarding sockets |
Date: |
Tue, 30 Jun 2009 00:57:28 -0000 |
From: Jan Kiszka <address@hidden>
Mark sockets that describe host forwardings. This is required for their
(and only their) proper deletion and for pretty-printing.
Signed-off-by: Jan Kiszka <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>
diff --git a/slirp/slirp.c b/slirp/slirp.c
index 08c10f2..ad35c1f 100644
--- a/slirp/slirp.c
+++ b/slirp/slirp.c
@@ -793,11 +793,11 @@ int slirp_add_hostfwd(int is_udp, struct in_addr
host_addr, int host_port,
}
if (is_udp) {
if (!udp_listen(host_addr.s_addr, htons(host_port), guest_addr.s_addr,
- htons(guest_port), 0))
+ htons(guest_port), SS_HOSTFWD))
return -1;
} else {
if (!tcp_listen(host_addr.s_addr, htons(host_port), guest_addr.s_addr,
- htons(guest_port), 0))
+ htons(guest_port), SS_HOSTFWD))
return -1;
}
return 0;
diff --git a/slirp/socket.h b/slirp/socket.h
index 2cf476c..979b191 100644
--- a/slirp/socket.h
+++ b/slirp/socket.h
@@ -72,6 +72,7 @@ struct socket {
#define SS_FACCEPTONCE 0x200 /* If set, the SS_FACCEPTCONN socket
will die after one accept */
#define SS_PERSISTENT_MASK 0xf000 /* Unremovable state bits */
+#define SS_HOSTFWD 0x1000 /* Socket describes host->guest
forwarding */
extern struct socket tcb;
diff --git a/slirp/udp.c b/slirp/udp.c
index 3722845..60fe754 100644
--- a/slirp/udp.c
+++ b/slirp/udp.c
@@ -667,7 +667,7 @@ udp_listen(u_int32_t haddr, u_int hport, u_int32_t laddr,
u_int lport,
so->so_expire = 0;
so->so_state &= SS_PERSISTENT_MASK;
- so->so_state |= SS_ISFCONNECTED;
+ so->so_state |= SS_ISFCONNECTED | flags;
return so;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-commits] [COMMIT 6dd5ffb] slirp: Explicitely mark host-forwarding sockets,
Anthony Liguori <=