diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2014-09-01 10:07:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-02 15:57:04 -0400 |
commit | 1889b0e7efe8373793069bd3deb7702a51e6f2a5 (patch) | |
tree | e08762b7392e09d5ccba1cbed090de58a6391986 /net/core | |
parent | 5d1180fcacc5ceb7da5494acfe9c5e4ebad4f281 (diff) |
rtnl/do_setlink(): set modified when IFLA_LINKMODE is updated
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>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/rtnetlink.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 5bbaf74bf457..2bd9fb15b987 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -1624,8 +1624,12 @@ static int do_setlink(const struct sk_buff *skb, | |||
1624 | set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE])); | 1624 | set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE])); |
1625 | 1625 | ||
1626 | if (tb[IFLA_LINKMODE]) { | 1626 | if (tb[IFLA_LINKMODE]) { |
1627 | unsigned char value = nla_get_u8(tb[IFLA_LINKMODE]); | ||
1628 | |||
1627 | write_lock_bh(&dev_base_lock); | 1629 | write_lock_bh(&dev_base_lock); |
1628 | dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]); | 1630 | if (dev->link_mode ^ value) |
1631 | modified = 1; | ||
1632 | dev->link_mode = value; | ||
1629 | write_unlock_bh(&dev_base_lock); | 1633 | write_unlock_bh(&dev_base_lock); |
1630 | } | 1634 | } |
1631 | 1635 | ||