From 8ce188ecb0a0d19874f8c0e663d5d8adffa50d43 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Fri, 21 May 2021 11:14:51 +0200 Subject: tcp: Properly initialise parameters for SO_ACCEPTCONN getsockopt() Signed-off-by: Stefano Brivio --- tcp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tcp.c') diff --git a/tcp.c b/tcp.c index d70267b..1de6d99 100644 --- a/tcp.c +++ b/tcp.c @@ -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); -- cgit v1.2.3