Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2853524imm; Mon, 10 Sep 2018 07:26:02 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdb6trNJko2molz8yaS90HTaf5Ro8bFe5EfxgL+v3RLC4EZ+BYceiyAZlMD5/hVAKDmemj/7 X-Received: by 2002:a63:7511:: with SMTP id q17-v6mr23388682pgc.144.1536589562118; Mon, 10 Sep 2018 07:26:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536589562; cv=none; d=google.com; s=arc-20160816; b=w3S0Z4z79iqb3GgDxTBMtdWz6c5asqLc9+c6OhC2vocDvUOhC7KD8ajFVrZmCzxH4Z wW82oaNs+yq7LmYQzKSVcdpTIh07I7LvIq5zFhkCtpGgOSmu6k0iTSS12SJ8+pwpfvDv mqsBb/UxC7CaR/Lr/wzNSNelWD3jhj0lkqZ0L+Z/kmisq6yAD8v8jmCFNVMFmtWYaqvx euA/fEUvH6XFLs9DP01761algA3M/ZwznTc9iCGfmVEGizg69a5xdSGm8Ojbpuc6m2SB rfwaO3/zgNT6ZkY1WAwU5lLDL+wXNAR5C45DDYbBl6nsr/ZLxUtPXB3+0xuhZk09Ufmj OLXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=DS69oZuXlIexAfxs5Lvoc8mpqX4ttPQ42mPypR0b0y0=; b=Empk6TE4YYCFEhcnxihAWdozFtqEEyl1v0JyC7QIpgOrMu+g4r8gqVM0cCyv6nwTHO ktJeF4Y1Q5xuP/521CNijyJJUWdx4TxLG4J8DrK9pfoszlMVEJ6G9IcNMkIqxVyH78W0 azv3bamH9buvhjh6QZexo2cPAywVRjFmAjRf2sFPyJpiaVb8KuVCrtpeO9XiJGRoH9dU mdkeawW4QXkOzPs4SgKPnPLxEYu/l7HfTgy9+dI0Ay4Un9hjnibIZY7oBH47+hZs9LAR m8Jc3QmFHaaBcHdoCLqDpnhWiAFhiTXAHyXcGDJ4NQ5e0uf8nLQxemYR7lLVWshTWOLS l1dQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s195-v6si17672760pgs.492.2018.09.10.07.25.07; Mon, 10 Sep 2018 07:26:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728736AbeIJTOk (ORCPT + 99 others); Mon, 10 Sep 2018 15:14:40 -0400 Received: from cmccmta1.chinamobile.com ([221.176.66.79]:8199 "EHLO cmccmta1.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728110AbeIJTOk (ORCPT ); Mon, 10 Sep 2018 15:14:40 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.17]) by rmmx-syy-dmz-app03-12003 (RichMail) with SMTP id 2ee35b967d9aae2-5ed14; Mon, 10 Sep 2018 22:20:10 +0800 (CST) X-RM-TRANSID: 2ee35b967d9aae2-5ed14 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost (unknown[223.105.0.240]) by rmsmtp-syy-appsvr09-12009 (RichMail) with SMTP id 2ee95b967d98a76-e5c3b; Mon, 10 Sep 2018 22:20:09 +0800 (CST) X-RM-TRANSID: 2ee95b967d98a76-e5c3b From: Haishuang Yan To: "David S. Miller" , Alexey Kuznetsov Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Haishuang Yan , William Tu Subject: [PATCH 1/2] erspan: return PACKET_REJECT when the appropriate tunnel is not found Date: Mon, 10 Sep 2018 22:19:47 +0800 Message-Id: <1536589188-27550-1-git-send-email-yanhaishuang@cmss.chinamobile.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Haishuang Yan --- net/ipv4/ip_gre.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- 1.8.3.1