diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2021-05-21 11:14:51 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2021-05-21 11:14:51 +0200 |
commit | 8ce188ecb0a0d19874f8c0e663d5d8adffa50d43 (patch) | |
tree | 367c827e2ed1003e96173abeea1d0dca209ecec1 /tcp.c | |
parent | bd5aaaac7f48e6788999d3c291f566933dc9daa6 (diff) | |
download | passt-8ce188ecb0a0d19874f8c0e663d5d8adffa50d43.tar passt-8ce188ecb0a0d19874f8c0e663d5d8adffa50d43.tar.gz passt-8ce188ecb0a0d19874f8c0e663d5d8adffa50d43.tar.bz2 passt-8ce188ecb0a0d19874f8c0e663d5d8adffa50d43.tar.lz passt-8ce188ecb0a0d19874f8c0e663d5d8adffa50d43.tar.xz passt-8ce188ecb0a0d19874f8c0e663d5d8adffa50d43.tar.zst passt-8ce188ecb0a0d19874f8c0e663d5d8adffa50d43.zip |
tcp: Properly initialise parameters for SO_ACCEPTCONN getsockopt()
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp.c')
-rw-r--r-- | tcp.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1418,18 +1418,19 @@ static void tcp_connect_finish(struct ctx *c, int s) void tcp_sock_handler(struct ctx *c, int s, uint32_t events, char *pkt_buf, struct timespec *now) { + int accept = -1; socklen_t sl; - int accept; (void)pkt_buf; + sl = sizeof(accept); + if (tc[s].s == LAST_ACK) { tcp_send_to_tap(c, s, ACK, NULL, 0); tcp_close_and_epoll_del(c, s); return; } - if (tc[s].s == SOCK_SYN_SENT) { /* This can only be a socket error or a shutdown from remote */ tcp_rst(c, s); |