]> git.baikalelectronics.ru Git - kernel.git/commitdiff
erspan: fix error handling for erspan tunnel
authorHaishuang Yan <yanhaishuang@cmss.chinamobile.com>
Mon, 10 Sep 2018 14:19:48 +0000 (22:19 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Sep 2018 06:50:54 +0000 (23:50 -0700)
When processing icmp unreachable message for erspan tunnel, tunnel id
should be erspan_net_id instead of ipgre_net_id.

Fixes: 468dae257e70 ("gre: introduce native tunnel support for ERSPAN")
Cc: William Tu <u9012063@gmail.com>
Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Acked-by: William Tu <u9012063@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_gre.c

index 85a714d36b66bd9e73209e8f2a490c3da43aff30..8cce0e9ea08cb454f28b4dfdd17bb2875470a7f6 100644 (file)
@@ -178,6 +178,9 @@ static void ipgre_err(struct sk_buff *skb, u32 info,
 
        if (tpi->proto == htons(ETH_P_TEB))
                itn = net_generic(net, gre_tap_net_id);
+       else if (tpi->proto == htons(ETH_P_ERSPAN) ||
+                tpi->proto == htons(ETH_P_ERSPAN2))
+               itn = net_generic(net, erspan_net_id);
        else
                itn = net_generic(net, ipgre_net_id);