Skip to content

Commit e64d4de

Browse files
matttbePaolo Abeni
authored andcommitted
mptcp: add TCP_FASTOPEN_NO_COOKIE support
The goal of this socket option is to configure MPTCP + TFO without cookie per socket. It was already possible to enable TFO without a cookie per netns by setting net.ipv4.tcp_fastopen sysctl knob to the right value. Per route was also supported by setting 'fastopen_no_cookie' option. This patch adds a per socket support like it is possible to do with TCP thanks to TCP_FASTOPEN_NO_COOKIE socket option. The only thing to do here is to relay the request to the first subflow like it is already done for TCP_FASTOPEN_CONNECT. Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent d3d4290 commit e64d4de

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

net/mptcp/sockopt.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ static bool mptcp_supported_sockopt(int level, int optname)
560560
case TCP_TX_DELAY:
561561
case TCP_INQ:
562562
case TCP_FASTOPEN_CONNECT:
563+
case TCP_FASTOPEN_NO_COOKIE:
563564
return true;
564565
}
565566

@@ -568,8 +569,8 @@ static bool mptcp_supported_sockopt(int level, int optname)
568569
/* TCP_REPAIR, TCP_REPAIR_QUEUE, TCP_QUEUE_SEQ, TCP_REPAIR_OPTIONS,
569570
* TCP_REPAIR_WINDOW are not supported, better avoid this mess
570571
*/
571-
/* TCP_FASTOPEN_KEY, TCP_FASTOPEN, TCP_FASTOPEN_NO_COOKIE,
572-
* are not supported fastopen is currently unsupported
572+
/* TCP_FASTOPEN_KEY, TCP_FASTOPEN are not supported because
573+
* fastopen for the listener side is currently unsupported
573574
*/
574575
}
575576
return false;
@@ -811,6 +812,7 @@ static int mptcp_setsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
811812
case TCP_DEFER_ACCEPT:
812813
return mptcp_setsockopt_sol_tcp_defer(msk, optval, optlen);
813814
case TCP_FASTOPEN_CONNECT:
815+
case TCP_FASTOPEN_NO_COOKIE:
814816
return mptcp_setsockopt_first_sf_only(msk, SOL_TCP, optname,
815817
optval, optlen);
816818
}
@@ -1175,6 +1177,7 @@ static int mptcp_getsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
11751177
case TCP_CC_INFO:
11761178
case TCP_DEFER_ACCEPT:
11771179
case TCP_FASTOPEN_CONNECT:
1180+
case TCP_FASTOPEN_NO_COOKIE:
11781181
return mptcp_getsockopt_first_sf_only(msk, SOL_TCP, optname,
11791182
optval, optlen);
11801183
case TCP_INQ:

0 commit comments

Comments
 (0)