Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
[firefly-linux-kernel-4.4.55.git] / net / ipv6 / esp6.c
index db1521fcda5b3fd182a3068c9b86d5161e5e4d56..6dc7fd353ef53f9c08c9202340fc953bf3b294c5 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/random.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
+#include <net/ip6_route.h>
 #include <net/icmp.h>
 #include <net/ipv6.h>
 #include <net/protocol.h>
@@ -433,15 +434,19 @@ static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
        struct xfrm_state *x;
 
        if (type != ICMPV6_DEST_UNREACH &&
-           type != ICMPV6_PKT_TOOBIG)
+           type != ICMPV6_PKT_TOOBIG &&
+           type != NDISC_REDIRECT)
                return;
 
        x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr,
                              esph->spi, IPPROTO_ESP, AF_INET6);
        if (!x)
                return;
-       pr_debug("pmtu discovery on SA ESP/%08x/%pI6\n",
-                ntohl(esph->spi), &iph->daddr);
+
+       if (type == NDISC_REDIRECT)
+               ip6_redirect(skb, net, 0, 0);
+       else
+               ip6_update_pmtu(skb, net, info, 0, 0);
        xfrm_state_put(x);
 }