ipv4: Handle PMTU in all ICMP error handlers.
[deliverable/linux.git] / net / ipv4 / ip_gre.c
index f49047b796096d1ce8ccd577db04556b576bc120..594cec35ac4df198b4afb956104c1e5120c8c0ed 100644 (file)
@@ -516,9 +516,6 @@ static void ipgre_err(struct sk_buff *skb, u32 info)
                case ICMP_PORT_UNREACH:
                        /* Impossible event. */
                        return;
-               case ICMP_FRAG_NEEDED:
-                       /* Soft state for pmtu is maintained by IP core. */
-                       return;
                default:
                        /* All others are translated to HOST_UNREACH.
                           rfc2003 contains "deep thoughts" about NET_UNREACH,
@@ -538,7 +535,16 @@ static void ipgre_err(struct sk_buff *skb, u32 info)
                                flags & GRE_KEY ?
                                *(((__be32 *)p) + (grehlen / 4) - 1) : 0,
                                p[1]);
-       if (t == NULL || t->parms.iph.daddr == 0 ||
+       if (t == NULL)
+               goto out;
+
+       if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) {
+               ipv4_update_pmtu(skb, dev_net(skb->dev), info,
+                                t->parms.link, 0, IPPROTO_GRE, 0);
+               goto out;
+       }
+
+       if (t->parms.iph.daddr == 0 ||
            ipv4_is_multicast(t->parms.iph.daddr))
                goto out;
 
This page took 0.043278 seconds and 5 git commands to generate.