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 <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
}
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;
#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;
so->so_expire = 0;
so->so_state &= SS_PERSISTENT_MASK;
- so->so_state |= SS_ISFCONNECTED;
+ so->so_state |= SS_ISFCONNECTED | flags;
return so;
}