netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v3 1/1] net: tcp: Permit user set TCP_MAXSEG to default value
@ 2017-03-21  1:28 fgao
  2017-03-22 18:48 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: fgao @ 2017-03-21  1:28 UTC (permalink / raw)
  To: davem, kuznet, jmorris, eric.dumazet, netdev, gfree.wind; +Cc: Gao Feng

From: Gao Feng <fgao@ikuai8.com>

When user_mss is zero, it means use the default value. But the current
codes don't permit user set TCP_MAXSEG to the default value.
It would return the -EINVAL when val is zero.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
---
 v3: Correct the logic error, per Neal
 v2: Make codes more clearer, per Eric
 v1: initial version

 net/ipv4/tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 1e319a5..4f7f163 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2470,7 +2470,7 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
 		/* Values greater than interface MTU won't take effect. However
 		 * at the point when this call is done we typically don't yet
 		 * know which interface is going to be used */
-		if (val < TCP_MIN_MSS || val > MAX_TCP_WINDOW) {
+		if (val && (val < TCP_MIN_MSS || val > MAX_TCP_WINDOW)) {
 			err = -EINVAL;
 			break;
 		}
-- 
1.9.1

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

* Re: [PATCH net v3 1/1] net: tcp: Permit user set TCP_MAXSEG to default value
  2017-03-21  1:28 [PATCH net v3 1/1] net: tcp: Permit user set TCP_MAXSEG to default value fgao
@ 2017-03-22 18:48 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-03-22 18:48 UTC (permalink / raw)
  To: fgao; +Cc: kuznet, jmorris, eric.dumazet, netdev, gfree.wind

From: fgao@ikuai8.com
Date: Tue, 21 Mar 2017 09:28:03 +0800

> From: Gao Feng <fgao@ikuai8.com>
> 
> When user_mss is zero, it means use the default value. But the current
> codes don't permit user set TCP_MAXSEG to the default value.
> It would return the -EINVAL when val is zero.
> 
> Signed-off-by: Gao Feng <fgao@ikuai8.com>
> ---
>  v3: Correct the logic error, per Neal
>  v2: Make codes more clearer, per Eric
>  v1: initial version

Applied to net-next, thanks.

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

end of thread, other threads:[~2017-03-22 18:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-21  1:28 [PATCH net v3 1/1] net: tcp: Permit user set TCP_MAXSEG to default value fgao
2017-03-22 18:48 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).