[PATCH mptcp-next v5 02/11] mptcp: take TCP_MAXSEG handling into setsockopt_set_val

Geliang Tang <[email protected]>
Newsgroups dev.linux.lists.mptcp
Message-ID <7098d1c0ba657fd29963f0a5bc1e4931875494bf.1786159812.git.tanggeliang@kylinos.cn>
From: Gang Yan <[email protected]>

Replace mptcp_setsockopt_all_sf() with __mptcp_setsockopt_set_val()
for TCP_MAXSEG option handling. This aligns the implementation with
other socket options that use the same helper and simplifies the code.

Co-developed-by: Geliang Tang <[email protected]>
Signed-off-by: Geliang Tang <[email protected]>
Signed-off-by: Gang Yan <[email protected]>
---
 net/mptcp/sockopt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
index 2c1eaf66202a..5de371e29721 100644
--- a/net/mptcp/sockopt.c
+++ b/net/mptcp/sockopt.c
@@ -968,9 +968,9 @@ static int mptcp_setsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
 						 val);
 		break;
 	case TCP_MAXSEG:
-		msk->maxseg = val;
-		ret = mptcp_setsockopt_all_sf(msk, SOL_TCP, optname, optval,
-					      optlen);
+		ret = __mptcp_setsockopt_set_val(msk, MAX_TCP_WINDOW,
+						 &tcp_sock_set_maxseg,
+						 &msk->maxseg, val);
 		break;
 	default:
 		ret = -ENOPROTOOPT;
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.