netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Gospodarek <andrew.gospodarek@broadcom.com>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
	davem@davemloft.net, Jiri Pirko <jiri@resnulli.us>,
	Wang Chen <wangchen@cn.fujitsu.com>,
	Veaceslav Falico <vfalico@redhat.com>,
	Nikolay Aleksandrov <nikolay@redhat.com>
Subject: Re: [PATCH net 3/3] bonding: process the err returned by dev_set_allmulti properly in bond_enslave
Date: Mon, 26 Mar 2018 12:07:19 -0400	[thread overview]
Message-ID: <20180326160719.GC92743@C02RW35GFVH8> (raw)
In-Reply-To: <5695ce418ff6d7a2755053d6c7c35dfd3ebf2d6b.1521997984.git.lucien.xin@gmail.com>

On Mon, Mar 26, 2018 at 01:16:47AM +0800, Xin Long wrote:
> When dev_set_promiscuity(1) succeeds but dev_set_allmulti(1) fails,
> dev_set_promiscuity(-1) should be done before going to the err path.
> Otherwise, dev->promiscuity will leak.
> 
> Fixes: 7e1a1ac1fbaa ("bonding: Check return of dev_set_promiscuity/allmulti")
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Acked-by: Andy Gospodarek <andy@greyhouse.net>

> ---
>  drivers/net/bonding/bond_main.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 55e1985..b7b1130 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -1706,8 +1706,11 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
>  		/* set allmulti level to new slave */
>  		if (bond_dev->flags & IFF_ALLMULTI) {
>  			res = dev_set_allmulti(slave_dev, 1);
> -			if (res)
> +			if (res) {
> +				if (bond_dev->flags & IFF_PROMISC)
> +					dev_set_promiscuity(slave_dev, -1);
>  				goto err_sysfs_del;
> +			}
>  		}
>  
>  		netif_addr_lock_bh(bond_dev);

  reply	other threads:[~2018-03-26 16:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-25 17:16 [PATCH net 0/3] bonding: a bunch of fixes for dev hwaddr sync in bond_enslave Xin Long
2018-03-25 17:16 ` [PATCH net 1/3] bonding: fix the err path " Xin Long
2018-03-25 17:16   ` [PATCH net 2/3] bonding: move dev_mc_sync after master_upper_dev_link " Xin Long
2018-03-25 17:16     ` [PATCH net 3/3] bonding: process the err returned by dev_set_allmulti properly " Xin Long
2018-03-26 16:07       ` Andy Gospodarek [this message]
2018-03-26 15:46     ` [PATCH net 2/3] bonding: move dev_mc_sync after master_upper_dev_link " Andy Gospodarek
2018-03-26 14:06   ` [PATCH net 1/3] bonding: fix the err path for dev hwaddr sync " Nikolay Aleksandrov
2018-03-26 15:16   ` Andy Gospodarek
2018-03-26 14:16 ` [PATCH net 0/3] bonding: a bunch of fixes " Nikolay Aleksandrov
2018-03-26 16:52 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180326160719.GC92743@C02RW35GFVH8 \
    --to=andrew.gospodarek@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=jiri@resnulli.us \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@redhat.com \
    --cc=vfalico@redhat.com \
    --cc=wangchen@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).