From patchwork Fri Dec 9 15:21:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 13069730 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB37DC4332F for ; Fri, 9 Dec 2022 15:22:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230217AbiLIPWI (ORCPT ); Fri, 9 Dec 2022 10:22:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230369AbiLIPVq (ORCPT ); Fri, 9 Dec 2022 10:21:46 -0500 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22C8B88B57 for ; Fri, 9 Dec 2022 07:21:45 -0800 (PST) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-3cbdd6c00adso55998167b3.11 for ; Fri, 09 Dec 2022 07:21:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=XeM/Au3FFJ8CEHCB/2f39QOmF/U0wWpHKCHbe4zZIIQ=; b=gxEruyky3m8NIEd9NgO0Oj0koCU/ZsEDxfJuvzgcqn5JgS+vKwf/DZtvujjuGh6EuP Pxy+2g+ppZhCRBg+MUZOwi58dK32eSessVlYuvKrD6mQgVXQUDcU067oH8qMP2ogo7k7 VKOp+2vHa3i2XDgETN/055IWAOfkHEBsz9E7y1SFLFWzAOWeRWj8nBhqJYhdmdGTqsqL Y3nLAeMt+RH6BbEmiu22YFjH32K+dXbvEzX8PMP5ykeiVwTcqgAzt+ItMKSiuQfXCR5I HlP5HkDPrJ9SJfCSUu3okIQFU+FLZ4cEhY5vEDzr5LDU1FEkJ6sG9ArvOpEUWSDeBORo le7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=XeM/Au3FFJ8CEHCB/2f39QOmF/U0wWpHKCHbe4zZIIQ=; b=wNYzkIwi73bgXLK715+XVATTW+U65MNVqC/akmdTow0aE3qnm4RsBXb0ctSuNA54nx qxNYibmxd0qlzvA33PXuUTsqePTB0fYCoo45SI0TE0JsJiG5hVlDJHiMtffq1XK/HgbR 8+ISEA+Q6p7HZJ1ZoNEgJylfVw5nJi9ksaOTI8WbS/GL0N//LUnVHNZkb7zc++w86HjH 8gEcjQklvVtoXPUZyAtxeXF3LPDwwRL7loNhSMW9dhb9kK/UFPT6M4mrpCYRQwRkH34d VABZ7f/cTohQ/IHmxeFzREiMUBxOiLQ3FzSOIn46p35tRrqgzq5IL6K8pEbcpsiiINKD 78Xg== X-Gm-Message-State: ANoB5pnaPjM2yzDIf7GTErgtYVDdLdodLWtSSLX+qq44WE2uO/hrd0d3 tNVklBssHuuVEitKwYT2NhEJcOFIadiV6Q== X-Google-Smtp-Source: AA0mqf7lTrV/+2tdpC7D4iGAVrk//29D09IKVGjcXAlKjDxh4H4zSZlpTQ3blM1Y7UKqrbUgcIObcg== X-Received: by 2002:a05:7500:6812:b0:ea:bb47:96aa with SMTP id hd18-20020a057500681200b000eabb4796aamr437517gab.29.1670599303831; Fri, 09 Dec 2022 07:21:43 -0800 (PST) Received: from wsfd-netdev15.ntdv.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id i26-20020a05620a0a1a00b006fbae4a5f59sm39699qka.41.2022.12.09.07.21.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:21:43 -0800 (PST) From: Xin Long To: network dev Cc: davem@davemloft.net, kuba@kernel.org, Eric Dumazet , Paolo Abeni , Jiri Pirko , Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , Sridhar Samudrala , Stephen Hemminger , LiLiang Subject: [PATCH net-next 1/3] net: add IFF_NO_ADDRCONF and use it in bonding to prevent ipv6 addrconf Date: Fri, 9 Dec 2022 10:21:38 -0500 Message-Id: <948924df0ed4f60e5bd0d7caaa53615ca6335f0c.1670599241.git.lucien.xin@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Currently, in bonding it reused the IFF_SLAVE flag and checked it in ipv6 addrconf to prevent ipv6 addrconf. However, it is not a proper flag to use for no ipv6 addrconf, for bonding it has to move IFF_SLAVE flag setting ahead of dev_open() in bond_enslave(). Also, IFF_MASTER/SLAVE are historical flags used in bonding and eql, as Jiri mentioned, the new devices like Team, Failover do not use this flag. So as Jiri suggested, this patch adds IFF_NO_ADDRCONF in priv_flags of the device to indicate no ipv6 addconf, and uses it in bonding and moves IFF_SLAVE flag setting back to its original place. Signed-off-by: Xin Long --- drivers/net/bonding/bond_main.c | 18 +++++++++++++----- include/linux/netdevice.h | 3 ++- net/ipv6/addrconf.c | 4 ++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index e01bb0412f1c..c1cc44223786 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -1632,13 +1632,19 @@ static int bond_master_upper_dev_link(struct bonding *bond, struct slave *slave, { struct netdev_lag_upper_info lag_upper_info; enum netdev_lag_tx_type type; + int err; type = bond_lag_tx_type(bond); lag_upper_info.tx_type = type; lag_upper_info.hash_type = bond_lag_hash_type(bond, type); - return netdev_master_upper_dev_link(slave->dev, bond->dev, slave, - &lag_upper_info, extack); + err = netdev_master_upper_dev_link(slave->dev, bond->dev, slave, + &lag_upper_info, extack); + if (err) + return err; + + slave->dev->flags |= IFF_SLAVE; + return 0; } static void bond_upper_dev_unlink(struct bonding *bond, struct slave *slave) @@ -1950,8 +1956,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev, } } - /* set slave flag before open to prevent IPv6 addrconf */ - slave_dev->flags |= IFF_SLAVE; + /* set no_addrconf flag before open to prevent IPv6 addrconf */ + slave_dev->priv_flags |= IFF_NO_ADDRCONF; /* open the slave since the application closed it */ res = dev_open(slave_dev, extack); @@ -2254,7 +2260,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev, dev_close(slave_dev); err_restore_mac: - slave_dev->flags &= ~IFF_SLAVE; + slave_dev->priv_flags &= ~IFF_NO_ADDRCONF; if (!bond->params.fail_over_mac || BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) { /* XXX TODO - fom follow mode needs to change master's @@ -2446,6 +2452,8 @@ static int __bond_release_one(struct net_device *bond_dev, /* close slave before restoring its mac address */ dev_close(slave_dev); + slave_dev->priv_flags &= ~IFF_NO_ADDRCONF; + if (bond->params.fail_over_mac != BOND_FOM_ACTIVE || BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) { /* restore original ("permanent") mac address */ diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index f78db610ada5..34f9752a715b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -1658,6 +1658,7 @@ struct net_device_ops { * @IFF_FAILOVER: device is a failover master device * @IFF_FAILOVER_SLAVE: device is lower dev of a failover master device * @IFF_L3MDEV_RX_HANDLER: only invoke the rx handler of L3 master device + * @IFF_NO_ADDRCONF: prevent ipv6 addrconf * @IFF_TX_SKB_NO_LINEAR: device/driver is capable of xmitting frames with * skb_headlen(skb) == 0 (data starts from frag0) * @IFF_CHANGE_PROTO_DOWN: device supports setting carrier via IFLA_PROTO_DOWN @@ -1693,7 +1694,7 @@ enum netdev_priv_flags { IFF_FAILOVER = 1<<27, IFF_FAILOVER_SLAVE = 1<<28, IFF_L3MDEV_RX_HANDLER = 1<<29, - /* was IFF_LIVE_RENAME_OK */ + IFF_NO_ADDRCONF = BIT_ULL(30), IFF_TX_SKB_NO_LINEAR = BIT_ULL(31), IFF_CHANGE_PROTO_DOWN = BIT_ULL(32), }; diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 9c3f5202a97b..c338dfb05d2c 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -3320,7 +3320,7 @@ static void addrconf_addr_gen(struct inet6_dev *idev, bool prefix_route) return; /* no link local addresses on devices flagged as slaves */ - if (idev->dev->flags & IFF_SLAVE) + if (idev->dev->priv_flags & IFF_NO_ADDRCONF) return; ipv6_addr_set(&addr, htonl(0xFE800000), 0, 0, 0); @@ -3560,7 +3560,7 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event, if (idev && idev->cnf.disable_ipv6) break; - if (dev->flags & IFF_SLAVE) { + if (dev->priv_flags & IFF_NO_ADDRCONF) { if (event == NETDEV_UP && !IS_ERR_OR_NULL(idev) && dev->flags & IFF_UP && dev->flags & IFF_MULTICAST) ipv6_mc_up(idev); From patchwork Fri Dec 9 15:21:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 13069733 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05E06C4167B for ; Fri, 9 Dec 2022 15:22:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230334AbiLIPWQ (ORCPT ); Fri, 9 Dec 2022 10:22:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230373AbiLIPVr (ORCPT ); Fri, 9 Dec 2022 10:21:47 -0500 Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 620878D1AE for ; Fri, 9 Dec 2022 07:21:46 -0800 (PST) Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-40b40ff39f1so18490557b3.10 for ; Fri, 09 Dec 2022 07:21:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=hfO5TuGwdyECtXG+osL0YPPNewICtjy/EFZ/kYLs3Ps=; b=Ew/tv54pA0xZLNdQL5jzX6UIJ3SuGCE/UY1tQ0XZtIkAc8MVNIXSAH3hD4KAB9Izoy ss47+pRtHqal/HdzujIdWGYCOf7L+cqRvTj83NXad6/S3oHcL3BO8xfW2jA6ZYwhFnwS 5BlDQEdG5mD2eefUsLGhIlHXXfkd7HYMxLXyK8GRGVqDtiAZhLfcMrTwJNN5OEPbIs+P KNoUpCrdwJZw+RtV/3FRpW9MpVj/eaKqCJppP1fjwF6GoBX0FPn/gfVxEc/y7x7mbESS fftKL6EH/uRVc5DyPyLEIeao7OJJTlyJGROCQSCyquU791qTwe6WI8xtrRILa2LJW2lh uL+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=hfO5TuGwdyECtXG+osL0YPPNewICtjy/EFZ/kYLs3Ps=; b=qjhZaqpf4Udc6Yrj8jXZYpqBDqWSKVRQBlQVDCyg9MpwZYdStEaagCO8eP+enVNWNL UZ4hjwSy6vBuQfIDWfKrLsf3ZlmBhOtoeADIw1O3Q07gV9W2Q5F83vOMPWWuFRup/SCD AnLadrVea6NzGeiBDjHL/EuEvxxwQRPTsHQgVcVPnqBGGeaknLGgbClcgjAIydk5QXQX AlgvwwzcwawRUByeIojZlE7x1sAvZzazckQueOQnfVplPCN+YJFMM30wLflP7WZEpLhw rLHs5ZkQXzJYnXwB8rrnPm1iE5ipLMfkBNjvNjQCGdscRFdDvDd/TXs1fOqWHfC8N6/G 3DkQ== X-Gm-Message-State: ANoB5pkgCxTUmZymheXNnH5crvm47U6BrqUL7p5ZwhAMNHxpBcDlB0yr WsWSBHCDk3jaEeFRGw6f04D/agYMJ6COxw== X-Google-Smtp-Source: AA0mqf74ZcxAuRTqOPxtAfOgI0Ci7aRxBH41xgmhkiLTc5x3wVsAXFvIHFJ/bHNIM6SzroCTsRKPRQ== X-Received: by 2002:a05:7500:5511:b0:ea:7107:6b67 with SMTP id x17-20020a057500551100b000ea71076b67mr493702gac.45.1670599305119; Fri, 09 Dec 2022 07:21:45 -0800 (PST) Received: from wsfd-netdev15.ntdv.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id i26-20020a05620a0a1a00b006fbae4a5f59sm39699qka.41.2022.12.09.07.21.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:21:44 -0800 (PST) From: Xin Long To: network dev Cc: davem@davemloft.net, kuba@kernel.org, Eric Dumazet , Paolo Abeni , Jiri Pirko , Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , Sridhar Samudrala , Stephen Hemminger , LiLiang Subject: [PATCH net-next 2/3] net: team: use IFF_NO_ADDRCONF flag to prevent ipv6 addrconf Date: Fri, 9 Dec 2022 10:21:39 -0500 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch is to use IFF_NO_ADDRCONF flag to prevent ipv6 addrconf for Team port. This flag will be set in team_port_enter(), which is called before dev_open(), and cleared in team_port_leave(), called after dev_close() and the err path in team_port_add(). Signed-off-by: Xin Long --- drivers/net/team/team.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index d10606f257c4..fcd43d62d86b 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c @@ -1044,6 +1044,7 @@ static int team_port_enter(struct team *team, struct team_port *port) goto err_port_enter; } } + port->dev->priv_flags |= IFF_NO_ADDRCONF; return 0; @@ -1057,6 +1058,7 @@ static void team_port_leave(struct team *team, struct team_port *port) { if (team->ops.port_leave) team->ops.port_leave(team, port); + port->dev->priv_flags &= ~IFF_NO_ADDRCONF; dev_put(team->dev); } From patchwork Fri Dec 9 15:21:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 13069731 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7794C4332F for ; Fri, 9 Dec 2022 15:22:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230326AbiLIPWM (ORCPT ); Fri, 9 Dec 2022 10:22:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230328AbiLIPVt (ORCPT ); Fri, 9 Dec 2022 10:21:49 -0500 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 462268D663 for ; Fri, 9 Dec 2022 07:21:47 -0800 (PST) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-3cbdd6c00adso56000217b3.11 for ; Fri, 09 Dec 2022 07:21:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=2+mnzttDRrZL4jubISGmMwdgtj3XMMFHwL38AYGjbcY=; b=eOqm4TFv/Df9rRhZYgEsid4Nrg75ebQpLjDaSe8mFghfDNcx6HxeTAgX0VFcagNtsz OBib6ZZA8uLmJ0nIzRs0LozgyGxZikc9mHqkFzUecHKn/vrFO4uYGQ/iIqMeNe3GC2tf 2NnhcbP6j9utR7rg489K+53x2/LmgmK7n1EFHS1mGoXJGGOAXvCObiuv1grYdLTWNE2P lg0vZGsIVJq17kEtrbP19pazW2aro4fJA+Fm6vNt0NDv1OEWdKXo+VeHdHsZukq/0lLP jHshLzJaW3BVlm+4bf4SXIGmfYgNCvDIGjsHm5p22DigaQE/3AYa725/aChuXIZq+meT 3Mlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=2+mnzttDRrZL4jubISGmMwdgtj3XMMFHwL38AYGjbcY=; b=B6P92KMUgD7hy0MvNMm/KFR8SY98qtNNG8uIt9Ma27Ug0TqQQHJL5WJhZ4yezk4in/ RSH5orIjkhObrclAiF0uhU3/GPmACGaT484Gt7+YxBT4xlQrUKopGQ/AtA4dvClZKKVB vq+bB2l8KfphFsYXQaKBmW76HZDtaCkljpA91d7MPnvBMnTZguI2RkaW8YAl7g3Kqfd5 h9gM29VI2EkakPn7x70JJKoPzZjqcW8p9+J+AzDtft/71882GVPmlpvf/+blgbQJpJ2f LnsHtkK0HyHZ6wQodbFGglYynGRoa6/PoKsmI4C5DCJD+hn2TaY1RVbHrK1XwtznCnql 1Utg== X-Gm-Message-State: ANoB5pmUclzpJJ/lEtDnX8eNuI7GwLnS1ZvKQ1ju9kRR2/NAJ8wcCB3C IMLSGkuggaVkwv/P0p4CnxTa8FDWYhrMyA== X-Google-Smtp-Source: AA0mqf7jl7E88PkYleGFZRatkNKccWuVEPVcal3J0X8hrc9OAzF/l9Da9ibiOJH2dkiqiz4HM1/F2A== X-Received: by 2002:a05:7500:140f:b0:ea:5d80:2833 with SMTP id v15-20020a057500140f00b000ea5d802833mr548053gaa.58.1670599306334; Fri, 09 Dec 2022 07:21:46 -0800 (PST) Received: from wsfd-netdev15.ntdv.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id i26-20020a05620a0a1a00b006fbae4a5f59sm39699qka.41.2022.12.09.07.21.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:21:45 -0800 (PST) From: Xin Long To: network dev Cc: davem@davemloft.net, kuba@kernel.org, Eric Dumazet , Paolo Abeni , Jiri Pirko , Jay Vosburgh , Veaceslav Falico , Andy Gospodarek , Sridhar Samudrala , Stephen Hemminger , LiLiang Subject: [PATCH net-next 3/3] net: failover: use IFF_NO_ADDRCONF flag to prevent ipv6 addrconf Date: Fri, 9 Dec 2022 10:21:40 -0500 Message-Id: <313ff2644295062566673f7130636a6a6e88682b.1670599241.git.lucien.xin@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Similar to Bonding and Team, to prevent ipv6 addrconf with IFF_NO_ADDRCONF in slave_dev->priv_flags for slave ports is also needed in net failover. Note that dev_open(slave_dev) is called in .slave_register, which is called after the IFF_NO_ADDRCONF flag is set in failover_slave_register(). Signed-off-by: Xin Long --- net/core/failover.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/core/failover.c b/net/core/failover.c index 655411c4ca51..2a140b3ea669 100644 --- a/net/core/failover.c +++ b/net/core/failover.c @@ -80,14 +80,14 @@ static int failover_slave_register(struct net_device *slave_dev) goto err_upper_link; } - slave_dev->priv_flags |= IFF_FAILOVER_SLAVE; + slave_dev->priv_flags |= (IFF_FAILOVER_SLAVE | IFF_NO_ADDRCONF); if (fops && fops->slave_register && !fops->slave_register(slave_dev, failover_dev)) return NOTIFY_OK; netdev_upper_dev_unlink(slave_dev, failover_dev); - slave_dev->priv_flags &= ~IFF_FAILOVER_SLAVE; + slave_dev->priv_flags &= ~(IFF_FAILOVER_SLAVE | IFF_NO_ADDRCONF); err_upper_link: netdev_rx_handler_unregister(slave_dev); done: @@ -121,7 +121,7 @@ int failover_slave_unregister(struct net_device *slave_dev) netdev_rx_handler_unregister(slave_dev); netdev_upper_dev_unlink(slave_dev, failover_dev); - slave_dev->priv_flags &= ~IFF_FAILOVER_SLAVE; + slave_dev->priv_flags &= ~(IFF_FAILOVER_SLAVE | IFF_NO_ADDRCONF); if (fops && fops->slave_unregister && !fops->slave_unregister(slave_dev, failover_dev))