]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:48:23 +0000 (19:48 -0600)
BugLink: https://bugs.launchpad.net/bugs/1836117
[ Upstream commit 5a64506b5c2c3cdb29d817723205330378075448 ]

If erspan tunnel hasn't been established, we'd better send icmp port
unreachable message after receive erspan packets.

Fixes: 84e54fe0a5ea ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
net/ipv4/ip_gre.c

index 54568841917d7e354560a8bd9002a3ddac84165f..de3ab29cec2ea01db9a4b1de3f898db4426beabc 100644 (file)
@@ -322,6 +322,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;