rtnl/do_setlink(): set modified when IFLA_LINKMODE is updated
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Mon, 1 Sep 2014 14:07:27 +0000 (16:07 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Sep 2014 19:57:04 +0000 (12:57 -0700)
The only effect of this patch is to print a warning if IFLA_LINKMODE is updated
and a following change fails.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c

index 5bbaf74bf4571948f537b8fc7902f25265ee6ca3..2bd9fb15b987eab42012289e553e17eb4b83e0eb 100644 (file)
@@ -1624,8 +1624,12 @@ static int do_setlink(const struct sk_buff *skb,
                set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]));
 
        if (tb[IFLA_LINKMODE]) {
+               unsigned char value = nla_get_u8(tb[IFLA_LINKMODE]);
+
                write_lock_bh(&dev_base_lock);
-               dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
+               if (dev->link_mode ^ value)
+                       modified = 1;
+               dev->link_mode = value;
                write_unlock_bh(&dev_base_lock);
        }