]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net: rtnl_configure_link: fix dev flags changes arg to __dev_notify_flags
authorRoopa Prabhu <roopa@cumulusnetworks.com>
Wed, 12 Sep 2018 20:21:48 +0000 (13:21 -0700)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:50:25 +0000 (19:50 -0600)
BugLink: https://bugs.launchpad.net/bugs/1836287
[ Upstream commit 56a49d7048703f5ffdb84d3a0ee034108fba6850 ]

This fix addresses https://bugzilla.kernel.org/show_bug.cgi?id=201071

Commit 5025f7f7d506 wrongly relied on __dev_change_flags to notify users of
dev flag changes in the case when dev->rtnl_link_state = RTNL_LINK_INITIALIZED.
Fix it by indicating flag changes explicitly to __dev_notify_flags.

Fixes: 5025f7f7d506 ("rtnetlink: add rtnl_link_state check in rtnl_configure_link")
Reported-By: Liam mcbirnie <liam.mcbirnie@boeing.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/core/rtnetlink.c

index cbbf2906fa58aa58463fade4e2c863c535db3edd..6465948632a9d3256edaae95ce18a620a0a74595 100644 (file)
@@ -2641,7 +2641,7 @@ int rtnl_configure_link(struct net_device *dev, const struct ifinfomsg *ifm)
        }
 
        if (dev->rtnl_link_state == RTNL_LINK_INITIALIZED) {
-               __dev_notify_flags(dev, old_flags, 0U);
+               __dev_notify_flags(dev, old_flags, (old_flags ^ dev->flags));
        } else {
                dev->rtnl_link_state = RTNL_LINK_INITIALIZED;
                __dev_notify_flags(dev, old_flags, ~0U);