]> git.baikalelectronics.ru Git - kernel.git/commitdiff
erspan: return PACKET_REJECT when the appropriate tunnel is not found
authorHaishuang Yan <yanhaishuang@cmss.chinamobile.com>
Mon, 10 Sep 2018 14:19:47 +0000 (22:19 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Sep 2018 06:50:53 +0000 (23:50 -0700)
If erspan tunnel hasn't been established, we'd better send icmp port
unreachable message after receive erspan packets.

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 ae714aecc31c030cdce19fc5b2e92eb6ca214a16..85a714d36b66bd9e73209e8f2a490c3da43aff30 100644 (file)
@@ -328,6 +328,8 @@ static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi,
                ip_tunnel_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error);
                return PACKET_RCVD;
        }
+       return PACKET_REJECT;
+
 drop:
        kfree_skb(skb);
        return PACKET_RCVD;