Message ID | CAO1wt+Y7JfeCXnrR5BeZ7K6dErmB3nfdA4mRkFQ21S=VPCkLXg@mail.gmail.com |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
From: Vicente Jiménez <googuy@gmail.com> Date: Mon, 7 Nov 2016 12:11:59 +0100 > From bfc9a00e6b78d8eb60e46dacd7d761669d29a573 Mon Sep 17 00:00:00 2001 > From: Vicente Jimenez Aguilar <googuy@gmail.com> > Date: Mon, 31 Oct 2016 13:10:29 +0100 > Subject: [PATCH] ipv4: icmp: Fix pMTU handling for rarest case > > Restore network resistance to weird ICMP fragmentation needed messages > with next hop MTU equal to (or exceeding) dropped packet size > > Fixes: 46517008e116 ("ipv4: Kill ip_rt_frag_needed().") > Signed-off-by: Vicente Jimenez Aguilar <googuy@gmail.com> > --- > net/ipv4/icmp.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c > index 38abe70..c0af1d2 100644 > --- a/net/ipv4/icmp.c > +++ b/net/ipv4/icmp.c > @@ -776,6 +776,7 @@ static bool icmp_unreach(struct sk_buff *skb) > struct icmphdr *icmph; > struct net *net; > u32 info = 0; > + unsigned short old_mtu; > > net = dev_net(skb_dst(skb)->dev); > Order local variable declarations from longest to shortest line please. > + if ( info >= old_mtu ) There should be no space after the '(' and before the ')' in this conditional.
From bfc9a00e6b78d8eb60e46dacd7d761669d29a573 Mon Sep 17 00:00:00 2001 From: Vicente Jimenez Aguilar <googuy@gmail.com> Date: Mon, 31 Oct 2016 13:10:29 +0100 Subject: [PATCH] ipv4: icmp: Fix pMTU handling for rarest case Restore network resistance to weird ICMP fragmentation needed messages with next hop MTU equal to (or exceeding) dropped packet size Fixes: 46517008e116 ("ipv4: Kill ip_rt_frag_needed().") Signed-off-by: Vicente Jimenez Aguilar <googuy@gmail.com> --- net/ipv4/icmp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 38abe70..c0af1d2 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c @@ -776,6 +776,7 @@ static bool icmp_unreach(struct sk_buff *skb) struct icmphdr *icmph; struct net *net; u32 info = 0; + unsigned short old_mtu; net = dev_net(skb_dst(skb)->dev); @@ -819,6 +820,12 @@ static bool icmp_unreach(struct sk_buff *skb) /* fall through */ case 0: info = ntohs(icmph->un.frag.mtu); + /* Handle weird case where next hop MTU is + * equal to or exceeding dropped packet size + */ + old_mtu = ntohs(iph->tot_len); + if ( info >= old_mtu ) + info = old_mtu - 2; } break; case ICMP_SR_FAILED: -- 2.7.3