lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1330423278.2610.17.camel@edumazet-laptop>
Date:	Tue, 28 Feb 2012 02:01:18 -0800
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	roy.qing.li@...il.com
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH 2/2] ipv4: fix mss comparison

Le mardi 28 février 2012 à 16:28 +0800, roy.qing.li@...il.com a écrit :
> From: RongQing.Li <roy.qing.li@...il.com>
> 
> mss should compare with 65535 - sizeof(struct tcphdr),  
> the largest mss is 65535 - sizeof(struct tcphdr).  
> 40 is sum of sizeof(struct tcphdr) and sizeof(struct iphdr)
> 
> Signed-off-by: RongQing.Li <roy.qing.li@...il.com>
> ---
>  net/ipv4/route.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index 0489ced..c72f765 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -1914,8 +1914,8 @@ static unsigned int ipv4_default_advmss(const struct dst_entry *dst)
>  	if (advmss == 0) {
>  		advmss = max_t(unsigned int, dst->dev->mtu - 40,
>  			       ip_rt_min_advmss);
> -		if (advmss > 65535 - 40)
> -			advmss = 65535 - 40;
> +		if (advmss > 65535 - sizeof(struct tcphdr))
> +			advmss = 65535 - sizeof(struct tcphdr);
>  	}
>  	return advmss;
>  }

Hmm... I am puzzled.

1) If you touch this code, please use min_t() macro to be consistent
with prior line ? Please note I dont advocate a general use of these
min/max macros, just some consistency in the same page of code.

2) Prior line still has the magic 40 value.
    (I personally like 40 more than sizeof(struct tcphdr) +
sizeof(struct iphdr)), its not like 40 is going to change one day :)

3) What is the maximum datagram size in ipv4.
      (Say you name this IPV4_MAXPLEN)

4) What would be the meaning of having TCP MSS bigger than
    IPV4_MAXPLEN - 40 ?



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ