@@ -8252,6 +8252,7 @@ static int __dev_set_promiscuity(struct net_device *dev, int inc, bool notify)
}
dev_change_rx_flags(dev, IFF_PROMISC);
+ __netdev_state_change(dev, IFF_PROMISC);
}
if (notify)
__dev_notify_flags(dev, old_flags, IFF_PROMISC);
@@ -8306,6 +8307,7 @@ static int __dev_set_allmulti(struct net_device *dev, int inc, bool notify)
}
if (dev->flags ^ old_flags) {
dev_change_rx_flags(dev, IFF_ALLMULTI);
+ __netdev_state_change(dev, IFF_ALLMULTI);
dev_set_rx_mode(dev);
if (notify)
__dev_notify_flags(dev, old_flags,
Some drivers may be interested in the change in promiscuity on other devices, like for example switchdev drivers may be interested in a promiscuity change on the bridge. In fact this was also suggested as a valid thing to do a while ago by Jiri Pirko: https://lore.kernel.org/all/20190829182957.GA17530@lunn.ch/t/#m6de7937f694ab1375723bab7c53a7fb2d3595332 yet it doesn't work. This is because, for probably legacy reasons, __dev_notify_flags() omits changes to IFF_PROMISC | IFF_ALLMULTI (RX flags), as well as a bunch of other flags (maybe simply because it wasn't needed, maybe because of other reasons). It may be tempting to hook this into (actually remove the restriction from) __dev_notify_flags(), but that is an unreliable place to put it, since __dev_set_promiscuity() may be called with "notify=false" and we'd still like to emit the NETDEV_CHANGE anyway. So put the netdev notifier call right next to the dev_change_rx_flags() call, for both IFF_PROMISC and IFF_ALLMULTI. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> --- net/core/dev.c | 2 ++ 1 file changed, 2 insertions(+)