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=-5.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 AB4F3C432BE for ; Wed, 1 Sep 2021 02:29:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8721E60F91 for ; Wed, 1 Sep 2021 02:29:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241573AbhIACaQ (ORCPT ); Tue, 31 Aug 2021 22:30:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241128AbhIACaP (ORCPT ); Tue, 31 Aug 2021 22:30:15 -0400 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BB69C061575 for ; Tue, 31 Aug 2021 19:29:19 -0700 (PDT) Received: by mail-pg1-x52f.google.com with SMTP id q68so1217857pga.9 for ; Tue, 31 Aug 2021 19:29:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=4+iwUAqRJPZFhGI73o3Zv3rff4AudFKJDzrL7OGaY4E=; b=f/FYv4nlGKVV93m9RtKw1dAEY6TWLMrl1gdpTDwIoaZGuTzDYGLpLplJ0nTnFg4z0l qWjPSLFmn0j1FmbPKbnZDbLywcy2IfUGb6BXB411c//Wg6nd7rNObO8L6A9jftLra8En AH/SPFUi4jlun+y0UfuR7JRoM4JwF/uxVyVAQp2qKOwnik71mqxC5Yxyci2YzMCKdWOS Lc4EanRWSzUVGM6VKKAAIlJnMaLEtqHbggDVo970xWnudeS6AR/DNlxxzVniJWIT5Qrw Gvg7+fhnKhY3tp40OLAl99Md/QRi8tXehM/NLDfLSrECGu5lOp3cOCTyk0MeCB/tUioF cmnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=4+iwUAqRJPZFhGI73o3Zv3rff4AudFKJDzrL7OGaY4E=; b=Y5M/wVihwlOKhNjpefivWDOPagYd2jNDfOrpUYwkpIzymESHLlwBM+pP2/irgdc9VW 5vNiKj50iNATckCNmyncvfUOPrL8pw8+V52crkj6ULywUWTVB/dC3x2/v/wBQXr25D7q XJD9gG67nDmZ9rMCK/NJnIiTKQa7QlkB8u8VQhiMc4OJq8POcQ7m3P7REjgQTrm+zDu0 HdfORGDc0vygeg4we4S5Z2HNuDWOe6pWyqUa1Ah7sfqCJmjFb3yvZuo15Yz4ABF2G0Iz YAdK+DsuDgUm6gmlklQGpwe8YFJEoN7AyeyVE8VjHObpbuG5O+FRiOb/ZrX8yJmNia0w W+4g== X-Gm-Message-State: AOAM5329njLMj75MbZAEuYY5Ohd8ZrRA1XPOPiRfd9zEiJwI5MgnLj9N j9HcyuImONrJYIESZu8Hw1g= X-Google-Smtp-Source: ABdhPJySz6shuVf4t3xEMCqWs24dszc+b8jf8QFCXAyjmnK9HC6dKXFvDGypo3usRKNNN+ezKdRJrQ== X-Received: by 2002:a62:1c4e:0:b0:3ee:7c8e:ce6 with SMTP id c75-20020a621c4e000000b003ee7c8e0ce6mr31193091pfc.60.1630463358716; Tue, 31 Aug 2021 19:29:18 -0700 (PDT) Received: from Davids-MacBook-Pro.local ([8.45.42.119]) by smtp.googlemail.com with ESMTPSA id m64sm22597143pga.55.2021.08.31.19.29.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 Aug 2021 19:29:18 -0700 (PDT) Subject: Re: Change in behavior for bound vs unbound sockets To: Paul Menzel , Saikrishna Arcot , Mike Manning Cc: netdev@vger.kernel.org, "David S. Miller" References: <06425eb5-906a-5805-d293-70d240a1197b@molgen.mpg.de> From: David Ahern Message-ID: Date: Tue, 31 Aug 2021 19:29:15 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <06425eb5-906a-5805-d293-70d240a1197b@molgen.mpg.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 8/31/21 3:12 AM, Paul Menzel wrote: >> I traced it to one commit (6da5b0f027a8 "net: ensure unbound datagram >> socket to be chosen when not in a VRF") that makes sure that when not >> in a VRF, the unbound socket is chosen over the bound socket, if both >> are available. If I revert this commit and two other commits that >> made changes on top of this, I can see that packets get sent to the >> bound socket instead. There's similar commits made for TCP and raw >> sockets as well, as part of that patch series. > > Commit 6da5b0f027a8 (net: ensure unbound datagram socket to be chosen > when not in a VRF) was added to Linux 5.0. > >> Is the intention of those commits also meant to affect sockets that >> are bound to just regular interfaces (and not only VRFs)? If so, >> since this change breaks a userspace application, is it possible to >> add a config that reverts to the old behavior, where bound sockets >> are preferred over unbound sockets? > If it breaks user space, the old behavior needs to be restored according > to Linux’ no regression policy. Let’s hope, in the future, there is > better testing infrastructure and such issues are noticed earlier. 5.0 was 2-1/2 years ago. Feel free to add tests to tools/testing/selftests/net/fcnal-test.sh to cover any missing permutations, including what you believe is the problem here. Both IPv4 and IPv6 should be added for consistency across protocols. nettest.c has a lot of the networking APIs, supports udp, tcp, raw, ...