Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp725330imm; Thu, 13 Sep 2018 06:53:11 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaSCjfdubI+lL5Tl4FZgreWrJb6o/+7VpFyMFABq6dMbPMFpLxqcnFfiMQi8JL7qMuG8FOi X-Received: by 2002:a17:902:28aa:: with SMTP id f39-v6mr7518819plb.150.1536846791398; Thu, 13 Sep 2018 06:53:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536846791; cv=none; d=google.com; s=arc-20160816; b=Q4pTqcRDnsH2eMAa2MVpy9UPMA3B3c63a4mfpk45cAPXeu3Shef4iP4t4746KgPdd/ mqBQGl6xO1zSpstBrsddk5bxanknsevOlPCSTSLjbwFb8hPk9NsU3jhFyvUje5fGL1PJ dvon0IoCKFxGEJM1MD1NlrGY92TvaCQxfU81Uf0VM0cRn6c8PudeBpP/ALVAwIm3F6Zi XDckp0Q5uAK6Ob2flpFjddf5I6rMtnO0NOrFmkh9Ko2qkIhYEhkZ0+XYiNBrtTsxfKUA fEiwzxRPLyS0rCPxSoeYvWo2jf7GwJjN+y5k6jqDIKIKzliaNUHFPcFxBgIbYCmZTBbX OVHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=s1YX+YNsy3rS0PL/YLoWhuEJIvAIwQbwPf1KmYTosDY=; b=jCrpK8bCSvXZ/GzkZp5IF70pptYz2QlYkOfxXmvbHiZFR1fGlXIGRN/XUCMQgF12Jg X/IMiu1mR2DwZTLcY+DAEBxbBiJ6PqynVeRNB9FhCKAl9/DJ2rLCPNs+arQgkP6AZCGB fjeRF+DGKfyHFU/ULpgLkcTqtRchlQRuxrUyTj8jAt9b+V2PzRFWETx56NF6zzQ0cCmM ap6jxFIBWAEZO+pQSW5KuLkP8k4M+ZWvGcwv2b0Z/l607ysOp3hYM85t/l1M3n+JhIM9 n9x90gD7TZNhXhy/ADpuyjrLfQzrtGckt0zrgQhAd2l+hI8gKhcfs3VVrmAIxX5ilvY6 XK8g== 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 m10-v6si4457362pgc.105.2018.09.13.06.52.55; Thu, 13 Sep 2018 06:53:11 -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 S1730626AbeIMTAw (ORCPT + 99 others); Thu, 13 Sep 2018 15:00:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33272 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730214AbeIMTAv (ORCPT ); Thu, 13 Sep 2018 15:00:51 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 76CFBD10; Thu, 13 Sep 2018 13:51:16 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jianlin Shi , Xin Long , "David S. Miller" Subject: [PATCH 4.18 021/197] erspan: set erspan_ver to 1 by default when adding an erspan dev Date: Thu, 13 Sep 2018 15:29:30 +0200 Message-Id: <20180913131842.412239756@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xin Long [ Upstream commit 84581bdae9587023cea1d139523f0ef0f28bd88d ] After erspan_ver is introudced, if erspan_ver is not set in iproute, its value will be left 0 by default. Since Commit 02f99df1875c ("erspan: fix invalid erspan version."), it has broken the traffic due to the version check in erspan_xmit if users are not aware of 'erspan_ver' param, like using an old version of iproute. To fix this compatibility problem, it sets erspan_ver to 1 by default when adding an erspan dev in erspan_setup. Note that we can't do it in ipgre_netlink_parms, as this function is also used by ipgre_changelink. Fixes: 02f99df1875c ("erspan: fix invalid erspan version.") Reported-by: Jianlin Shi Signed-off-by: Xin Long Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/ip_gre.c | 3 +++ net/ipv6/ip6_gre.c | 1 + 2 files changed, 4 insertions(+) --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -1511,11 +1511,14 @@ nla_put_failure: static void erspan_setup(struct net_device *dev) { + struct ip_tunnel *t = netdev_priv(dev); + ether_setup(dev); dev->netdev_ops = &erspan_netdev_ops; dev->priv_flags &= ~IFF_TX_SKB_SHARING; dev->priv_flags |= IFF_LIVE_ADDR_CHANGE; ip_tunnel_setup(dev, erspan_net_id); + t->erspan_ver = 1; } static const struct nla_policy ipgre_policy[IFLA_GRE_MAX + 1] = { --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c @@ -1776,6 +1776,7 @@ static void ip6gre_netlink_parms(struct if (data[IFLA_GRE_COLLECT_METADATA]) parms->collect_md = true; + parms->erspan_ver = 1; if (data[IFLA_GRE_ERSPAN_VER]) parms->erspan_ver = nla_get_u8(data[IFLA_GRE_ERSPAN_VER]);