[1/2] erspan: return PACKET_REJECT when the appropriate tunnel is not found

Message ID 1536589188-27550-1-git-send-email-yanhaishuang@cmss.chinamobile.com
State Accepted
Delegated to: David Miller
Headers show
Series
  • [1/2] erspan: return PACKET_REJECT when the appropriate tunnel is not found
Related show

Commit Message

Haishuang Yan Sept. 10, 2018, 2:19 p.m.
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>
---
 net/ipv4/ip_gre.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

William Tu Sept. 10, 2018, 3:53 p.m. | #1
On Mon, Sep 10, 2018 at 7:20 AM Haishuang Yan
<yanhaishuang@cmss.chinamobile.com> wrote:
>
> 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>
> ---

LGTM.
Acked-by: William Tu <u9012063@gmail.com>
David Miller Sept. 12, 2018, 6:52 a.m. | #2
From: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Date: Mon, 10 Sep 2018 22:19:47 +0800

> 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>

Applied and queued up for -stable.

Patch

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index ae714ae..85a714d 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -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;