Message ID | 1298023023.2595.170.camel@edumazet-laptop |
---|---|
State | Superseded, archived |
Delegated to: | David Miller |
Headers | show |
On Fri, Feb 18, 2011 at 5:57 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote: > > > I suspect following patch is needed > > CC Roland Dreier <roland@purestorage.com> because he fixed the > default_mtu problem in commit ec831ea72ee5d7d47 > (net: Add default_mtu() methods to blackhole dst_ops) > > Thanks ! > > [PATCH] net: Add default_advmss() methods to blackhole dst_ops > > Commit 0dbaee3b37e118a (net: Abstract default ADVMSS behind an > accessor.) introduced a possible crash in tcp_connect_init(), when > dst->default_advmss() is called from dst_metric_advmss() > > Reported-by: George Spelvin <linux@horizon.com> > Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> > CC: Roland Dreier <roland@purestorage.com> > --- > net/ipv4/route.c | 7 +++++++ > net/ipv6/route.c | 6 ++++++ > 2 files changed, 13 insertions(+) > > diff --git a/net/ipv4/route.c b/net/ipv4/route.c > index 788a3e7..5edb605 100644 > --- a/net/ipv4/route.c > +++ b/net/ipv4/route.c > @@ -2712,6 +2712,12 @@ static unsigned int ipv4_blackhole_default_mtu(const struct dst_entry *dst) > return 0; > } > > +static unsigned int ipv4_blackhole_default_advmss(const struct dst_entry *dst) > +{ > + return 256; > +} > + > + I am wondering why magic number 256 is used here. Is there a special reason? Thanks.
Le vendredi 18 février 2011 à 21:16 +0800, Changli Gao a écrit : > I am wondering why magic number 256 is used here. Is there a special > reason? Thanks. > It really doesnt matter. SYN message will be dropped anyway. 256 happens to be the default value of /proc/sys/net/ipv4/route/min_adv_mss -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, Feb 18, 2011 at 9:24 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote: > Le vendredi 18 février 2011 à 21:16 +0800, Changli Gao a écrit : > >> I am wondering why magic number 256 is used here. Is there a special >> reason? Thanks. >> > > It really doesnt matter. SYN message will be dropped anyway. > > 256 happens to be the default value > of /proc/sys/net/ipv4/route/min_adv_mss > Thanks for your explaining. IMHO, ip_rt_min_advmss is better than a magic number, here.
Le vendredi 18 février 2011 à 21:29 +0800, Changli Gao a écrit : > On Fri, Feb 18, 2011 at 9:24 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote: > > Le vendredi 18 février 2011 à 21:16 +0800, Changli Gao a écrit : > > > >> I am wondering why magic number 256 is used here. Is there a special > >> reason? Thanks. > >> > > > > It really doesnt matter. SYN message will be dropped anyway. > > > > 256 happens to be the default value > > of /proc/sys/net/ipv4/route/min_adv_mss > > > > Thanks for your explaining. IMHO, ip_rt_min_advmss is better than a > magic number, here. > I had this exact idea but found we need struct net pointer to get this value, not provided in parameters, so I falled back to the 256 value. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, Feb 18, 2011 at 3:33 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote: > Le vendredi 18 février 2011 à 21:29 +0800, Changli Gao a écrit : >> On Fri, Feb 18, 2011 at 9:24 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote: >> > Le vendredi 18 février 2011 à 21:16 +0800, Changli Gao a écrit : >> > >> >> I am wondering why magic number 256 is used here. Is there a special >> >> reason? Thanks. >> >> >> > >> > It really doesnt matter. SYN message will be dropped anyway. >> > >> > 256 happens to be the default value >> > of /proc/sys/net/ipv4/route/min_adv_mss Perhaps a comment would make sense then. thanks, Daniel. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
This makes sense to me; I was having trouble at the time with a loose ethernet cable (broken RJ45 retention clip), so the cable could have come unplugged at the time I tried to make the connection. Thank you very much! -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 788a3e7..5edb605 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -2712,6 +2712,12 @@ static unsigned int ipv4_blackhole_default_mtu(const struct dst_entry *dst) return 0; } +static unsigned int ipv4_blackhole_default_advmss(const struct dst_entry *dst) +{ + return 256; +} + + static void ipv4_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu) { } @@ -2722,6 +2728,7 @@ static struct dst_ops ipv4_dst_blackhole_ops = { .destroy = ipv4_dst_destroy, .check = ipv4_blackhole_dst_check, .default_mtu = ipv4_blackhole_default_mtu, + .default_advmss = ipv4_blackhole_default_advmss, .update_pmtu = ipv4_rt_blackhole_update_pmtu, }; diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 1c29f95..2eeeabb 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -118,6 +118,11 @@ static unsigned int ip6_blackhole_default_mtu(const struct dst_entry *dst) return 0; } +static unsigned int ip6_blackhole_default_advmss(const struct dst_entry *dst) +{ + return 256; +} + static void ip6_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu) { } @@ -128,6 +133,7 @@ static struct dst_ops ip6_dst_blackhole_ops = { .destroy = ip6_dst_destroy, .check = ip6_dst_check, .default_mtu = ip6_blackhole_default_mtu, + .default_advmss = ip6_blackhole_default_advmss, .update_pmtu = ip6_rt_blackhole_update_pmtu, };