From patchwork Fri Jul 14 08:13:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 13313246 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5FAAED2FF for ; Fri, 14 Jul 2023 08:13:57 +0000 (UTC) Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C26D3AA9 for ; Fri, 14 Jul 2023 01:13:56 -0700 (PDT) Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-3a337ddff16so1310857b6e.0 for ; Fri, 14 Jul 2023 01:13:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689322435; x=1691914435; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FmbfT+/MzwaSY9zZQ/qDB5qfN1/58V26qFzg36OlU7Q=; b=PonEMeGSdFDf8icwuQgtd/RnQX/ppKUPG6lyQVTabqKhl0WB8mqzRH1SLR5qG2w+52 nuxiZOTdCc7T9QUkNQImiIVyxG0uYtA3G/qTixpR5YRCijrgbq/vzmfqWKPLjf83KwGh QLUT+DDBWBaa4haU0/cFHFm34gx2/rJUMIPBK+PtvHZd73HPLEeTR/h8K/RZrSRlQyri n7PT4ig2z376jkLhZK84Lj41uHv0O8eXrxoX8UDmT4XN+s+dbt3ztKGQ/hfZMBcNrnj1 0DE4A2QLojb1Yi2Da8+junYnpsUaveMsAPcLQ41cCIIvrnLDIf01VYFIPwsjn9f3USmu zWwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689322435; x=1691914435; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FmbfT+/MzwaSY9zZQ/qDB5qfN1/58V26qFzg36OlU7Q=; b=QIGzyIBux/GZ6HAQ6GbTucQiTXVOPn1M8LowEOYsz38m5yLxpNuY/vE6nvPpm0IDUS tbGKlKlITWwJ2uMpNVEiBur6Ake7JnpHuglrS+nsJ/FRrPafd+1rNc87emNGetXyk9W6 qaItmlfyX5Bl7fdywAdB6NEvSmXJqEC4jO2u1Afw+a3kp5Ch4faBfa5p314LN/rhI/Ru 3Yq/1RqEZ+I93yhaeXfT9nQU7+sGBpesVi2vtdXkFUCdgrhhYRRHKs6TR5/NzmG8tcNp oGJudhHZrHSdMTvdnT6QQFxO6dePYJlvyMSCsCSotOQyPq9wN0yuZi6x/Qk7MgFBA6oF 7pTQ== X-Gm-Message-State: ABy/qLYiLykD515QYikocgEqyNlsBneyjc3FuTVNHnAxaN5qaEWUdeNK dgcP9EiGR5Qa0t6kHwr4/sR5fSzRo96GVA== X-Google-Smtp-Source: APBJJlEFe/FWuH9RButggwIsFTU9mUxwIpHEQcCuAMIo9Q1Sikz8wbGvrKGuYfe3uMfvWd1V9xHSjg== X-Received: by 2002:a05:6358:8812:b0:135:b4c:a490 with SMTP id hv18-20020a056358881200b001350b4ca490mr6153061rwb.10.1689322434850; Fri, 14 Jul 2023 01:13:54 -0700 (PDT) Received: from Laptop-X1.redhat.com ([2409:8a02:782f:8f50:d380:ebf:ef24:ac51]) by smtp.gmail.com with ESMTPSA id 20-20020a17090a199400b00263ba6a248bsm715268pji.1.2023.07.14.01.13.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jul 2023 01:13:54 -0700 (PDT) From: Hangbin Liu To: netdev@vger.kernel.org Cc: Jay Vosburgh , "David S . Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , Liang Li , Jiri Pirko , Nikolay Aleksandrov , Hangbin Liu Subject: [PATCHv2 net 1/2] bonding: reset bond's flags when down link is P2P device Date: Fri, 14 Jul 2023 16:13:39 +0800 Message-Id: <20230714081340.2064472-2-liuhangbin@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230714081340.2064472-1-liuhangbin@gmail.com> References: <20230714081340.2064472-1-liuhangbin@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org When adding a point to point downlink to the bond, we neglected to reset the bond's flags, which were still using flags like BROADCAST and MULTICAST. Consequently, this would initiate ARP/DAD for P2P downlink interfaces, such as when adding a GRE device to the bonding. To address this issue, let's reset the bond's flags for P2P interfaces. Before fix: 7: gre0@NONE: mtu 1500 qdisc noqueue master bond0 state UNKNOWN group default qlen 1000 link/gre6 2006:70:10::1 peer 2006:70:10::2 permaddr 167f:18:f188:: 8: bond0: mtu 1500 qdisc noqueue state UP group default qlen 1000 link/gre6 2006:70:10::1 brd 2006:70:10::2 inet6 fe80::200:ff:fe00:0/64 scope link valid_lft forever preferred_lft forever After fix: 7: gre0@NONE: mtu 1500 qdisc noqueue master bond2 state UNKNOWN group default qlen 1000 link/gre6 2006:70:10::1 peer 2006:70:10::2 permaddr c29e:557a:e9d9:: 8: bond0: mtu 1500 qdisc noqueue state UP group default qlen 1000 link/gre6 2006:70:10::1 peer 2006:70:10::2 inet6 fe80::1/64 scope link valid_lft forever preferred_lft forever Reported-by: Liang Li Links: https://bugzilla.redhat.com/show_bug.cgi?id=2221438 Fixes: 872254dd6b1f ("net/bonding: Enable bonding to enslave non ARPHRD_ETHER") Signed-off-by: Hangbin Liu --- drivers/net/bonding/bond_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 7a0f25301f7e..484c9e3e5e82 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1508,6 +1508,11 @@ static void bond_setup_by_slave(struct net_device *bond_dev, memcpy(bond_dev->broadcast, slave_dev->broadcast, slave_dev->addr_len); + + if (slave_dev->flags & IFF_POINTOPOINT) { + bond_dev->flags &= ~(IFF_BROADCAST | IFF_MULTICAST); + bond_dev->flags |= (IFF_POINTOPOINT | IFF_NOARP); + } } /* On bonding slaves other than the currently active slave, suppress From patchwork Fri Jul 14 08:13:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 13313247 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1086CD2FF for ; Fri, 14 Jul 2023 08:14:04 +0000 (UTC) Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4484B3AAE for ; Fri, 14 Jul 2023 01:13:59 -0700 (PDT) Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-3460aee1d57so7051695ab.0 for ; Fri, 14 Jul 2023 01:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689322438; x=1691914438; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WpuzNiJzoPJAnXLr2PGD3stMP4mts2t3lHbBmTcvHiQ=; b=qThPUBkAV1JG3BtvFko1MhghX1YUCGMjL0cn+D3M5/j5Gg6NaY17mDHzI9a6sXVZzb bAvUgOxjk9Yv2qiqb2r2xhIeuyII7fFpIdYsua4IM3ZW48sje1u5+m5OjFkFKSjDccyY FRRBCPuFFoC69ljfCBuUN+pqRyUJVBX+PD4BK6MbicABCsHFaBTKCLt7kmJX29WcwAvP fj48/IR8UM21d9de3rYrZl1b0i1TGyRyIK9ZYFy7CHXbnHI3eE3j11frGxfhxKkY4T0u n9vewBJ2PvQWM46G+TT/BWdKmeUtKiI9PjE45Md+Ntxi0iV5WLIFivTDyQt0t8jJykTt h7YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689322438; x=1691914438; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WpuzNiJzoPJAnXLr2PGD3stMP4mts2t3lHbBmTcvHiQ=; b=hvO1x5Pg4mHRFJCtRI6VTJtznNvGcf8u1Ot5SeGNb4lMyhOhLwaTKulYLgmIGjmZPv 215vqpChMCYDApjJEpK/haMcu+xgUB/a3X0WjWz8EWvD5R1SYWijgKMFp80imlPZhnv4 9SsZ+ujcgy08K4jKZ+LwYKHRzpCLMSyS0EYzwXiPXiA9UJXD27zb31pwJSxyYtsT/R0u UUdgVmrHDNiw8Irixn+ruSKQgHKXKXx7JpKoJYqgeZLuhAPmV+tlfiZfDcbF4U0h3Xkh KRUNRzizf+IAht2hDw2rOlGdZCfcQtqAROhwQVhfwXHrDMl246dfWwsicbT+MjUzqsD6 AJLA== X-Gm-Message-State: ABy/qLaIiHXPhVAOYjvlg6eSkpXn+wvGe5J0QYoftrbZLzfgy7CExm86 Zb+sf94Dd2PdQU1uvoDo5m7M1H7i8wbccg== X-Google-Smtp-Source: APBJJlFjGXPhhuRhmMjN5queMOSAz+UFbRHAbZLk7rCPTEsIrt773x0dE+luWGEzuBMxdR+9tEsHew== X-Received: by 2002:a92:cc4c:0:b0:347:7059:386c with SMTP id t12-20020a92cc4c000000b003477059386cmr3809363ilq.16.1689322438160; Fri, 14 Jul 2023 01:13:58 -0700 (PDT) Received: from Laptop-X1.redhat.com ([2409:8a02:782f:8f50:d380:ebf:ef24:ac51]) by smtp.gmail.com with ESMTPSA id 20-20020a17090a199400b00263ba6a248bsm715268pji.1.2023.07.14.01.13.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jul 2023 01:13:57 -0700 (PDT) From: Hangbin Liu To: netdev@vger.kernel.org Cc: Jay Vosburgh , "David S . Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , Liang Li , Jiri Pirko , Nikolay Aleksandrov , Hangbin Liu Subject: [PATCHv2 net 2/2] team: reset team's flags when down link is P2P device Date: Fri, 14 Jul 2023 16:13:40 +0800 Message-Id: <20230714081340.2064472-3-liuhangbin@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230714081340.2064472-1-liuhangbin@gmail.com> References: <20230714081340.2064472-1-liuhangbin@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org When adding a point to point downlink to team device, we neglected to reset the team's flags, which were still using flags like BROADCAST and MULTICAST. Consequently, this would initiate ARP/DAD for P2P downlink interfaces, such as when adding a GRE device to team device. Fix this by remove multicast/broadcast flags and add p2p and noarp flags. Reported-by: Liang Li Links: https://bugzilla.redhat.com/show_bug.cgi?id=2221438 Fixes: 1d76efe1577b ("team: add support for non-ethernet devices") Reviewed-by: Jiri Pirko Signed-off-by: Hangbin Liu --- drivers/net/team/team.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 555b0b1e9a78..9104e373c8cb 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c @@ -2135,6 +2135,11 @@ static void team_setup_by_port(struct net_device *dev, dev->mtu = port_dev->mtu; memcpy(dev->broadcast, port_dev->broadcast, port_dev->addr_len); eth_hw_addr_inherit(dev, port_dev); + + if (port_dev->flags & IFF_POINTOPOINT) { + dev->flags &= ~(IFF_BROADCAST | IFF_MULTICAST); + dev->flags |= (IFF_POINTOPOINT | IFF_NOARP); + } } static int team_dev_type_check_change(struct net_device *dev,