diff options
author | David S. Miller <davem@davemloft.net> | 2008-02-17 21:35:07 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-02-17 21:35:07 -0500 |
commit | 93b2d4a208eeb19bff95e98c34503ce4b03cd0f9 (patch) | |
tree | 4bbd045fe81e6535e97f42ac022e7429814a497b | |
parent | b57dfbc4f7f8d394c5e96677d2b66ffca1b4e8a7 (diff) |
Revert "[RTNETLINK]: Send a single notification on device state changes."
This reverts commit 45b503548210fe6f23e92b856421c2a3f05fd034.
It break locking around dev->link_mode as well as cause
other bootup problems.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/rtnetlink.c | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index ecb02afd52dc..61ac8d06292c 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -504,7 +504,7 @@ int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst, u32 id, | |||
504 | 504 | ||
505 | EXPORT_SYMBOL_GPL(rtnl_put_cacheinfo); | 505 | EXPORT_SYMBOL_GPL(rtnl_put_cacheinfo); |
506 | 506 | ||
507 | static int set_operstate(struct net_device *dev, unsigned char transition, bool send_notification) | 507 | static void set_operstate(struct net_device *dev, unsigned char transition) |
508 | { | 508 | { |
509 | unsigned char operstate = dev->operstate; | 509 | unsigned char operstate = dev->operstate; |
510 | 510 | ||
@@ -527,12 +527,8 @@ static int set_operstate(struct net_device *dev, unsigned char transition, bool | |||
527 | write_lock_bh(&dev_base_lock); | 527 | write_lock_bh(&dev_base_lock); |
528 | dev->operstate = operstate; | 528 | dev->operstate = operstate; |
529 | write_unlock_bh(&dev_base_lock); | 529 | write_unlock_bh(&dev_base_lock); |
530 | 530 | netdev_state_change(dev); | |
531 | if (send_notification) | 531 | } |
532 | netdev_state_change(dev); | ||
533 | return 1; | ||
534 | } else | ||
535 | return 0; | ||
536 | } | 532 | } |
537 | 533 | ||
538 | static void copy_rtnl_link_stats(struct rtnl_link_stats *a, | 534 | static void copy_rtnl_link_stats(struct rtnl_link_stats *a, |
@@ -826,7 +822,6 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm, | |||
826 | if (tb[IFLA_BROADCAST]) { | 822 | if (tb[IFLA_BROADCAST]) { |
827 | nla_memcpy(dev->broadcast, tb[IFLA_BROADCAST], dev->addr_len); | 823 | nla_memcpy(dev->broadcast, tb[IFLA_BROADCAST], dev->addr_len); |
828 | send_addr_notify = 1; | 824 | send_addr_notify = 1; |
829 | modified = 1; | ||
830 | } | 825 | } |
831 | 826 | ||
832 | if (ifm->ifi_flags || ifm->ifi_change) { | 827 | if (ifm->ifi_flags || ifm->ifi_change) { |
@@ -839,23 +834,16 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm, | |||
839 | dev_change_flags(dev, flags); | 834 | dev_change_flags(dev, flags); |
840 | } | 835 | } |
841 | 836 | ||
842 | if (tb[IFLA_TXQLEN]) { | 837 | if (tb[IFLA_TXQLEN]) |
843 | if (dev->tx_queue_len != nla_get_u32(tb[IFLA_TXQLEN])) { | 838 | dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]); |
844 | dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]); | ||
845 | modified = 1; | ||
846 | } | ||
847 | } | ||
848 | 839 | ||
849 | if (tb[IFLA_OPERSTATE]) | 840 | if (tb[IFLA_OPERSTATE]) |
850 | modified |= set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]), false); | 841 | set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE])); |
851 | 842 | ||
852 | if (tb[IFLA_LINKMODE]) { | 843 | if (tb[IFLA_LINKMODE]) { |
853 | if (dev->link_mode != nla_get_u8(tb[IFLA_LINKMODE])) { | 844 | write_lock_bh(&dev_base_lock); |
854 | write_lock_bh(&dev_base_lock); | 845 | dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]); |
855 | dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]); | 846 | write_unlock_bh(&dev_base_lock); |
856 | write_lock_bh(&dev_base_lock); | ||
857 | modified = 1; | ||
858 | } | ||
859 | } | 847 | } |
860 | 848 | ||
861 | err = 0; | 849 | err = 0; |
@@ -869,10 +857,6 @@ errout: | |||
869 | 857 | ||
870 | if (send_addr_notify) | 858 | if (send_addr_notify) |
871 | call_netdevice_notifiers(NETDEV_CHANGEADDR, dev); | 859 | call_netdevice_notifiers(NETDEV_CHANGEADDR, dev); |
872 | |||
873 | if (modified) | ||
874 | netdev_state_change(dev); | ||
875 | |||
876 | return err; | 860 | return err; |
877 | } | 861 | } |
878 | 862 | ||
@@ -990,7 +974,7 @@ struct net_device *rtnl_create_link(struct net *net, char *ifname, | |||
990 | if (tb[IFLA_TXQLEN]) | 974 | if (tb[IFLA_TXQLEN]) |
991 | dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]); | 975 | dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]); |
992 | if (tb[IFLA_OPERSTATE]) | 976 | if (tb[IFLA_OPERSTATE]) |
993 | set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]), true); | 977 | set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE])); |
994 | if (tb[IFLA_LINKMODE]) | 978 | if (tb[IFLA_LINKMODE]) |
995 | dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]); | 979 | dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]); |
996 | 980 | ||