[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130924094707.41641042@nehalam.linuxnetplumber.net>
Date: Tue, 24 Sep 2013 09:47:07 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Nicolas Dichtel <nicolas.dichtel@...nd.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net
Subject: Re: [PATCH net-next v2] dev: always advertise rx_flags changes
On Tue, 24 Sep 2013 18:21:32 +0200
Nicolas Dichtel <nicolas.dichtel@...nd.com> wrote:
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 5c713f2239cc..067bfbe70c4c 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -4822,7 +4822,7 @@ static void dev_change_rx_flags(struct net_device *dev, int flags)
> ops->ndo_change_rx_flags(dev, flags);
> }
>
> -static int __dev_set_promiscuity(struct net_device *dev, int inc)
> +static int __dev_set_promiscuity(struct net_device *dev, int inc, bool notif)
> {
> unsigned int old_flags = dev->flags;
> kuid_t uid;
> @@ -4865,6 +4865,10 @@ static int __dev_set_promiscuity(struct net_device *dev, int inc)
>
> dev_change_rx_flags(dev, IFF_PROMISC);
> }
> + if (notif) {
> + call_netdevice_notifiers(NETDEV_CHANGE, dev);
> + rtmsg_ifinfo(RTM_NEWLINK, dev, IFF_PROMISC);
> + }
> return 0;
> }
This is getting uglier as the conditional is added to each
function. Why not create a helper function and change callers.
static void __dev_notify_flag(dev, int flags)
{
call_netdevice_notifiers(NETDEV_CHANGE, dev);
rtmsg_ifinfo(RTM_NEWLINK, dev, flags);
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists