From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4349CC2D0E5 for ; Thu, 26 Mar 2020 18:01:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E9F8C20722 for ; Thu, 26 Mar 2020 18:01:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=6wind.com header.i=@6wind.com header.b="JVhYtchK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727446AbgCZSB0 (ORCPT ); Thu, 26 Mar 2020 14:01:26 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:55272 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726163AbgCZSB0 (ORCPT ); Thu, 26 Mar 2020 14:01:26 -0400 Received: by mail-wm1-f68.google.com with SMTP id c81so7517114wmd.4 for ; Thu, 26 Mar 2020 11:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=reply-to:subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2P1CFBmWkodNTEHJl9eAUEsf6jWN/P2ba0zdgUc4ZDI=; b=JVhYtchKgiCrlsqEIEW6w1YamYMF68MWz7yGcNtXQTBBwLAb8D7yxp5JI7giu7EDeg 7L2NtytUjUElRIzRPBT8U1lRLHmPl0WcgjcGX8r7YmmivfOJdi03SGpi+ACTY/0cPK1m R+GTSoopqDuNPeJDZ14KUZAAo8+PialWyGBQlwpSR5D+V2nEaDtGEnxt0dtnfVTMx9vC 7UUusqn2fBHkfq3BojMYKLeNXj6lFZArBwXKaVQ+QgT/arkBcCTGNc61GzKdr7dn7VRp tNmStDfoVnFkxGHpYxO9Q3GPAYLqzTZhQCHnkXMNIOOeLjot4cnZAhxcYGs06dPuW4/g Q+vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=2P1CFBmWkodNTEHJl9eAUEsf6jWN/P2ba0zdgUc4ZDI=; b=Rmmuk8Qvc7dNekhQ5DWP13f22YSERKbCCuBBGeZzlbpsXx2sfQjDGTDqvXg6FDtvvT dAXXqtEVW13Uyj3+HeBBrb8LTw5e8QDLKR8Ah5+W7NqNEyv80rmUK5HWzandpLh2ck/W mvC8YzNuvj9HABCgWeenvTDIkh6syRtf+aUOROlwTceELqkq7x9qTSEPI3kUGb8k8Hvw kv4eVthL7N1uD2I1mZ5/hGiAwf5tc5kVcCQiCPsVWfN2/H8grCkcf3fQXANx1LpteSOQ J6rlwYCDc/FVqc7CiN7H6bvOHmfxDOwPEKQ0G1QIp+lG9tSu0RCkFvAtONz1xKS/8LSy Q6Yw== X-Gm-Message-State: ANhLgQ2D8PNYibAboYBYKyaiuRi6SeyOiWq4Mpw/bj9RYKezw9xQAeWi B+yCeQYf37+b0D/+3p1clwwH+A== X-Google-Smtp-Source: ADFU+vuEwjsGY7nOSHbD7owRRdeDwCyYrUdmgsgXqADMiaFsSamPnjpteBHJwIWQGBLY6bzoUp27aQ== X-Received: by 2002:a1c:bc84:: with SMTP id m126mr1091801wmf.171.1585245683283; Thu, 26 Mar 2020 11:01:23 -0700 (PDT) Received: from ?IPv6:2a01:e0a:410:bb00:18dc:21ce:7e5f:92a2? ([2a01:e0a:410:bb00:18dc:21ce:7e5f:92a2]) by smtp.gmail.com with ESMTPSA id 71sm4887572wrc.53.2020.03.26.11.01.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Mar 2020 11:01:21 -0700 (PDT) Reply-To: nicolas.dichtel@6wind.com Subject: Re: [PATCH net] net, ip_tunnel: fix interface lookup with no key To: William Dauchy , netdev@vger.kernel.org Cc: pshelar@nicira.com References: <20200325150304.5506-1-w.dauchy@criteo.com> From: Nicolas Dichtel Organization: 6WIND Message-ID: <67629ca1-ad66-735a-ecfc-28531b079c40@6wind.com> Date: Thu, 26 Mar 2020 19:01:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200325150304.5506-1-w.dauchy@criteo.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Le 25/03/2020 à 16:03, William Dauchy a écrit : > when creating a new ipip interface with no local/remote configuration, > the lookup is done with TUNNEL_NO_KEY flag, making it impossible to > match the new interface (only possible match being fallback or metada > case interface); e.g: `ip link add tunl1 type ipip dev eth0` > > If we consider `key` being zero in ipip case, we might consider ok to > go through this last loop, and make it possible to match such interface. > In fact this is what is done when we create a gre interface without key > and local/remote. > > context being on my side, I'm creating an extra ipip interface attached > to the physical one, and moving it to a dedicated namespace. > > Fixes: c54419321455 ("GRE: Refactor GRE tunneling code.") > Signed-off-by: William Dauchy > --- > net/ipv4/ip_tunnel.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c > index 74e1d964a615..f6578bcadbed 100644 > --- a/net/ipv4/ip_tunnel.c > +++ b/net/ipv4/ip_tunnel.c > @@ -142,9 +142,6 @@ struct ip_tunnel *ip_tunnel_lookup(struct ip_tunnel_net *itn, > cand = t; > } > > - if (flags & TUNNEL_NO_KEY) > - goto skip_key_lookup; > - Hmm, removing this test may break some existing scenario. This flag is part of the UAPI (for gre). Suppose that a tool configures a gre tunnel, leaves the key uninitialized and set this flag. After this patch, the lookup may return something else. Regards, Nicolas