tcp: Properly initialise parameters for SO_ACCEPTCONN getsockopt()
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
bd5aaaac7f
commit
8ce188ecb0
1 changed files with 3 additions and 2 deletions
5
tcp.c
5
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,
|
void tcp_sock_handler(struct ctx *c, int s, uint32_t events, char *pkt_buf,
|
||||||
struct timespec *now)
|
struct timespec *now)
|
||||||
{
|
{
|
||||||
|
int accept = -1;
|
||||||
socklen_t sl;
|
socklen_t sl;
|
||||||
int accept;
|
|
||||||
|
|
||||||
(void)pkt_buf;
|
(void)pkt_buf;
|
||||||
|
|
||||||
|
sl = sizeof(accept);
|
||||||
|
|
||||||
if (tc[s].s == LAST_ACK) {
|
if (tc[s].s == LAST_ACK) {
|
||||||
tcp_send_to_tap(c, s, ACK, NULL, 0);
|
tcp_send_to_tap(c, s, ACK, NULL, 0);
|
||||||
tcp_close_and_epoll_del(c, s);
|
tcp_close_and_epoll_del(c, s);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (tc[s].s == SOCK_SYN_SENT) {
|
if (tc[s].s == SOCK_SYN_SENT) {
|
||||||
/* This can only be a socket error or a shutdown from remote */
|
/* This can only be a socket error or a shutdown from remote */
|
||||||
tcp_rst(c, s);
|
tcp_rst(c, s);
|
||||||
|
|
Loading…
Reference in a new issue