public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
* net: getsockopt(TCP_MAXSEG) on listen sock returns wrong MSS?
@ 2023-05-17 11:08 Cambda Zhu
  2023-05-17 15:58 ` Eric Dumazet
  2023-05-19  8:01 ` [PATCH net-next] net: Return user_mss for TCP_MAXSEG in CLOSE/LISTEN state Cambda Zhu
  0 siblings, 2 replies; 11+ messages in thread
From: Cambda Zhu @ 2023-05-17 11:08 UTC (permalink / raw)
  To: netdev, David S. Miller, Eric Dumazet
  Cc: Xuan Zhuo, Dust Li, Tony Lu, Cambda Zhu

I want to call setsockopt(TCP_MAXSEG) on a listen sock to let
all child socks have smaller MSS. And I found the child sock
MSS changed but getsockopt(TCP_MAXSEG) on the listen sock
returns 536 always.

It seems the tp->mss_cache is initialized with TCP_MSS_DEFAULT,
but getsockopt(TCP_MAXSEG) returns tp->rx_opt.user_mss only when
tp->mss_cache is 0. I don't understand the purpose of the mss_cache
check of TCP_MAXSEG. If getsockopt(TCP_MAXSEG) on listen sock makes
no sense, why does it have a branch for close/listen sock to return
user_mss? If getsockopt(TCP_MAXSEG) on listen sock is ok, why does
it check mss_cache for a listen sock?

I tried to find the commit log about TCP_MAXSEG, and found that
in commit 0c409e85f0ac ("Import 2.3.41pre2"), the mss_cache check
was added. No more detailed information found. Is this a bug or am
I misunderstanding something?

Regards,
Cambda

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-05-24  9:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-17 11:08 net: getsockopt(TCP_MAXSEG) on listen sock returns wrong MSS? Cambda Zhu
2023-05-17 15:58 ` Eric Dumazet
2023-05-17 17:37   ` Cambda Zhu
2023-05-19  8:01 ` [PATCH net-next] net: Return user_mss for TCP_MAXSEG in CLOSE/LISTEN state Cambda Zhu
2023-05-23 10:28   ` Paolo Abeni
2023-05-23 11:52     ` Eric Dumazet
2023-05-24  7:10       ` Cambda Zhu
2023-05-24  9:30         ` Jason Xing
2023-05-23 13:45   ` Paolo Abeni
2023-05-24  1:04     ` Cambda Zhu
2023-05-24  2:11       ` Jason Xing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox