Commit 4a82347a470eb087b2cb3075c506c42051d20230
Committed by
Anthony Liguori
1 parent
9c12a6f2
slirp: Mark sockets of incoming TCP connections
Required for pretty-printing. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Showing
2 changed files
with
2 additions
and
0 deletions
slirp/socket.h
| @@ -73,6 +73,7 @@ struct socket { | @@ -73,6 +73,7 @@ struct socket { | ||
| 73 | 73 | ||
| 74 | #define SS_PERSISTENT_MASK 0xf000 /* Unremovable state bits */ | 74 | #define SS_PERSISTENT_MASK 0xf000 /* Unremovable state bits */ |
| 75 | #define SS_HOSTFWD 0x1000 /* Socket describes host->guest forwarding */ | 75 | #define SS_HOSTFWD 0x1000 /* Socket describes host->guest forwarding */ |
| 76 | +#define SS_INCOMING 0x2000 /* Connection was initiated by a host on the internet */ | ||
| 76 | 77 | ||
| 77 | extern struct socket tcb; | 78 | extern struct socket tcb; |
| 78 | 79 |
slirp/tcp_subr.c
| @@ -483,6 +483,7 @@ tcp_connect(struct socket *inso) | @@ -483,6 +483,7 @@ tcp_connect(struct socket *inso) | ||
| 483 | /* if it's not FACCEPTONCE, it's already NOFDREF */ | 483 | /* if it's not FACCEPTONCE, it's already NOFDREF */ |
| 484 | } | 484 | } |
| 485 | so->s = s; | 485 | so->s = s; |
| 486 | + so->so_state |= SS_INCOMING; | ||
| 486 | 487 | ||
| 487 | so->so_iptos = tcp_tos(so); | 488 | so->so_iptos = tcp_tos(so); |
| 488 | tp = sototcpcb(so); | 489 | tp = sototcpcb(so); |