Skip to content

Commit 1536e28

Browse files
nak3davem330
authored andcommitted
tcp: Add a TCP_FASTOPEN socket option to get a max backlog on its listner
This patch adds a TCP_FASTOPEN socket option to get a max backlog on its listener to getsockopt(). Signed-off-by: Kenjiro Nakayama <nakayamakenjiro@gmail.com> Acked-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6ff01db commit 1536e28

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

net/ipv4/tcp.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2916,6 +2916,14 @@ static int do_tcp_getsockopt(struct sock *sk, int level,
29162916
case TCP_USER_TIMEOUT:
29172917
val = jiffies_to_msecs(icsk->icsk_user_timeout);
29182918
break;
2919+
2920+
case TCP_FASTOPEN:
2921+
if (icsk->icsk_accept_queue.fastopenq != NULL)
2922+
val = icsk->icsk_accept_queue.fastopenq->max_qlen;
2923+
else
2924+
val = 0;
2925+
break;
2926+
29192927
case TCP_TIMESTAMP:
29202928
val = tcp_time_stamp + tp->tsoffset;
29212929
break;

0 commit comments

Comments
 (0)