From patchwork Thu Mar 22 22:07:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 889690 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Dod81PO7"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 406gxw2Tlvz9s0y for ; Fri, 23 Mar 2018 09:16:52 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 9C8ACF74; Thu, 22 Mar 2018 22:08:25 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 6DA99F7D for ; Thu, 22 Mar 2018 22:08:22 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 2FF2C360 for ; Thu, 22 Mar 2018 22:08:22 +0000 (UTC) Received: by mail-pf0-f195.google.com with SMTP id h11so3926335pfn.4 for ; Thu, 22 Mar 2018 15:08:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Rt79x/jAg2TfRhcj+BLx8vLK/RmXn++2BAavF5KZ/H0=; b=Dod81PO7tJ0J5zF+iIAORe1DArofPcHgcJIkiyLoLshE/WDLra2wpDFkCFqwxUDB/a GzupVpOZvqLViET2+NodJUNuVncUMxEdz/hum46AinAdVRuR5Pp5YxRnVmqRmqmDx7im TTDErd0UkcUBHa01PhHGqIXoI+aVojcX17hIch9dAzqTOEd0nduOuNhf8xxxuy4WBq3f oi2SZWzzUBP698JpVQVHOc1Rz2WalsoykTT1YtNvdd3vUlVqAj9ZxZua3yiI268bb8O7 wqEe6FP2arq0VCqO5HVHSUtovvZu54bva9bZmN4P6JOfv5iUafH2rBCCNeC35Nl+npXj Uykw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Rt79x/jAg2TfRhcj+BLx8vLK/RmXn++2BAavF5KZ/H0=; b=Ceqh3V4TbNVFnPF8llBmH7kBao1CdbS7tPKfX/AO00LJlS1zyIcwX8zWN4uu6ly3B9 OQ6caLMV3rLewDbtFC6dt+oT17TF/kHrM85bRFk7kv5K4d7Y++s7H0V+lTCUhVSUk5S8 T9wp8R/yzlI605cGeP91kM5UMiA84mwKv83mmLwnIgEDJQN6AA1nPvMMh100pUM5QNzR LQK9FssKByFeSya/iAg7MF5BeYd1vQdOqNTcNvYqsV1CEzraiJ5HbRdSJS8MCEvuqtmK yee1bfks7lUr3G11zUJcHLmhmAwX0kl2DRsXY02ky46Eec7hL+OkNSJ/sXRmcFpRqPX5 s2Xg== X-Gm-Message-State: AElRT7F5d8Ke5Ouwd/goh4jyxHuvP9EEdFeoLin8JUi/1my4jn6mWXEP FOOLnIN2EUB2Ry7u0gthstY1Yw== X-Google-Smtp-Source: AG47ELt33/b0ulYvAibXtnPTV1dnERaAruRuKmU9R17+3lLEoxp+i0MWpSZA0Fnl/d4RCS87Dwu/dQ== X-Received: by 10.98.156.16 with SMTP id f16mr21884841pfe.180.1521756501398; Thu, 22 Mar 2018 15:08:21 -0700 (PDT) Received: from gizo.domain (184-100-240-187.ptld.qwest.net. [184.100.240.187]) by smtp.gmail.com with ESMTPSA id 4sm2280775pfn.32.2018.03.22.15.08.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Mar 2018 15:08:20 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Thu, 22 Mar 2018 15:07:39 -0700 Message-Id: <1521756461-3870-24-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1521756461-3870-1-git-send-email-gvrose8192@gmail.com> References: <1521756461-3870-1-git-send-email-gvrose8192@gmail.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [ERSPAN RFC 23/25] erspan: fix erspan config overwrite X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: William Tu Upsteam commit: commit 39f57f6799cdd437277122d4cd1c470c08f527c0 Author: William Tu Date: Mon Feb 5 13:35:35 2018 -0800 net: erspan: fix erspan config overwrite When an erspan tunnel device receives an erpsan packet with different tunnel metadata (ex: version, index, hwid, direction), existing code overwrites the tunnel device's erspan configuration with the received packet's metadata. The patch fixes it. Fixes: 1a66a836da63 ("gre: add collect_md mode to ERSPAN tunnel") Fixes: f551c91de262 ("net: erspan: introduce erspan v2 for ip_gre") Fixes: ef7baf5e083c ("ip6_gre: add ip6 erspan collect_md mode") Fixes: 94d7d8f29287 ("ip6_gre: add erspan v2 support") Signed-off-by: William Tu Signed-off-by: David S. Miller This is just the ip_gre portion of the commit. The ip6_gre part of the commit was folded in during the prior commit to introduce ip6 gre and ip6 tunneling. Cc: William Tu Signed-off-by: Greg Rose --- datapath/linux/compat/ip_gre.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c index 5ebbdb5..08d3351 100644 --- a/datapath/linux/compat/ip_gre.c +++ b/datapath/linux/compat/ip_gre.c @@ -178,20 +178,6 @@ static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi, info = &tun_dst->u.tun_info; info->key.tun_flags |= TUNNEL_ERSPAN_OPT; info->options_len = sizeof(*md); - } else { - tunnel->erspan_ver = ver; - if (ver == 1) { - tunnel->index = ntohl(pkt_md->u.index); - } else { - u16 md2_flags; - u16 dir, hwid; - - md2_flags = ntohs(pkt_md->u.md2.flags); - dir = (md2_flags & DIR_MASK) >> DIR_OFFSET; - hwid = (md2_flags & HWID_MASK) >> HWID_OFFSET; - tunnel->dir = dir; - tunnel->hwid = hwid; - } } skb_reset_mac_header(skb);