aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-15 10:33:07 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-15 10:33:07 -0500
commitf6866fecd6fd8e44a6715da09844a4fd1b8484da (patch)
treea166c399ddb37a48035589ffda29ef05d236c4b4 /net/core
parent4ee29f6a52158cea526b16a44ae38643946103ec (diff)
parent997b37da1515c1620692521786a74af271664eb7 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (82 commits) [NET]: Make sure sockets implement splice_read netconsole: avoid null pointer dereference at show_local_mac() [IPV6]: Fix reversed local_df test in ip6_fragment [XFRM]: Avoid bogus BUG() when throwing new policy away. [AF_KEY]: Fix bug in spdadd [NETFILTER] nf_conntrack_proto_tcp.c: Mistyped state corrected. net: xfrm statistics depend on INET [NETFILTER]: make secmark_tg_destroy() static [INET]: Unexport inet_listen_wlock [INET]: Unexport __inet_hash_connect [NET]: Improve cache line coherency of ingress qdisc [NET]: Fix race in dev_close(). (Bug 9750) [IPSEC]: Fix bogus usage of u64 on input sequence number [RTNETLINK]: Send a single notification on device state changes. [NETLABLE]: Hide netlbl_unlabel_audit_addr6 under ifdef CONFIG_IPV6. [NETLABEL]: Don't produce unused variables when IPv6 is off. [NETLABEL]: Compilation for CONFIG_AUDIT=n case. [GENETLINK]: Relax dances with genl_lock. [NETLABEL]: Fix lookup logic of netlbl_domhsh_search_def. [IPV6]: remove unused method declaration (net/ndisc.h). ...
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c4
-rw-r--r--net/core/neighbour.c12
-rw-r--r--net/core/rtnetlink.c36
-rw-r--r--net/core/skbuff.c3
4 files changed, 32 insertions, 23 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index b3e19ae57f95..908f07c3bd7d 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1071,8 +1071,6 @@ int dev_close(struct net_device *dev)
1071 */ 1071 */
1072 call_netdevice_notifiers(NETDEV_GOING_DOWN, dev); 1072 call_netdevice_notifiers(NETDEV_GOING_DOWN, dev);
1073 1073
1074 dev_deactivate(dev);
1075
1076 clear_bit(__LINK_STATE_START, &dev->state); 1074 clear_bit(__LINK_STATE_START, &dev->state);
1077 1075
1078 /* Synchronize to scheduled poll. We cannot touch poll list, 1076 /* Synchronize to scheduled poll. We cannot touch poll list,
@@ -1083,6 +1081,8 @@ int dev_close(struct net_device *dev)
1083 */ 1081 */
1084 smp_mb__after_clear_bit(); /* Commit netif_running(). */ 1082 smp_mb__after_clear_bit(); /* Commit netif_running(). */
1085 1083
1084 dev_deactivate(dev);
1085
1086 /* 1086 /*
1087 * Call the device specific close. This cannot fail. 1087 * Call the device specific close. This cannot fail.
1088 * Only if device is UP 1088 * Only if device is UP
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index a16cf1ec5e5e..7bb6a9a1256d 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -834,18 +834,12 @@ static void neigh_timer_handler(unsigned long arg)
834 } 834 }
835 if (neigh->nud_state & (NUD_INCOMPLETE | NUD_PROBE)) { 835 if (neigh->nud_state & (NUD_INCOMPLETE | NUD_PROBE)) {
836 struct sk_buff *skb = skb_peek(&neigh->arp_queue); 836 struct sk_buff *skb = skb_peek(&neigh->arp_queue);
837 /* keep skb alive even if arp_queue overflows */ 837
838 if (skb)
839 skb_get(skb);
840 write_unlock(&neigh->lock);
841 neigh->ops->solicit(neigh, skb); 838 neigh->ops->solicit(neigh, skb);
842 atomic_inc(&neigh->probes); 839 atomic_inc(&neigh->probes);
843 if (skb)
844 kfree_skb(skb);
845 } else {
846out:
847 write_unlock(&neigh->lock);
848 } 840 }
841out:
842 write_unlock(&neigh->lock);
849 843
850 if (notify) 844 if (notify)
851 neigh_update_notify(neigh); 845 neigh_update_notify(neigh);
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 61ac8d06292c..ecb02afd52dc 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
505EXPORT_SYMBOL_GPL(rtnl_put_cacheinfo); 505EXPORT_SYMBOL_GPL(rtnl_put_cacheinfo);
506 506
507static void set_operstate(struct net_device *dev, unsigned char transition) 507static int set_operstate(struct net_device *dev, unsigned char transition, bool send_notification)
508{ 508{
509 unsigned char operstate = dev->operstate; 509 unsigned char operstate = dev->operstate;
510 510
@@ -527,8 +527,12 @@ static void set_operstate(struct net_device *dev, unsigned char transition)
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 netdev_state_change(dev); 530
531 } 531 if (send_notification)
532 netdev_state_change(dev);
533 return 1;
534 } else
535 return 0;
532} 536}
533 537
534static void copy_rtnl_link_stats(struct rtnl_link_stats *a, 538static void copy_rtnl_link_stats(struct rtnl_link_stats *a,
@@ -822,6 +826,7 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
822 if (tb[IFLA_BROADCAST]) { 826 if (tb[IFLA_BROADCAST]) {
823 nla_memcpy(dev->broadcast, tb[IFLA_BROADCAST], dev->addr_len); 827 nla_memcpy(dev->broadcast, tb[IFLA_BROADCAST], dev->addr_len);
824 send_addr_notify = 1; 828 send_addr_notify = 1;
829 modified = 1;
825 } 830 }
826 831
827 if (ifm->ifi_flags || ifm->ifi_change) { 832 if (ifm->ifi_flags || ifm->ifi_change) {
@@ -834,16 +839,23 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
834 dev_change_flags(dev, flags); 839 dev_change_flags(dev, flags);
835 } 840 }
836 841
837 if (tb[IFLA_TXQLEN]) 842 if (tb[IFLA_TXQLEN]) {
838 dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]); 843 if (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 }
839 848
840 if (tb[IFLA_OPERSTATE]) 849 if (tb[IFLA_OPERSTATE])
841 set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE])); 850 modified |= set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]), false);
842 851
843 if (tb[IFLA_LINKMODE]) { 852 if (tb[IFLA_LINKMODE]) {
844 write_lock_bh(&dev_base_lock); 853 if (dev->link_mode != nla_get_u8(tb[IFLA_LINKMODE])) {
845 dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]); 854 write_lock_bh(&dev_base_lock);
846 write_unlock_bh(&dev_base_lock); 855 dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
856 write_lock_bh(&dev_base_lock);
857 modified = 1;
858 }
847 } 859 }
848 860
849 err = 0; 861 err = 0;
@@ -857,6 +869,10 @@ errout:
857 869
858 if (send_addr_notify) 870 if (send_addr_notify)
859 call_netdevice_notifiers(NETDEV_CHANGEADDR, dev); 871 call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
872
873 if (modified)
874 netdev_state_change(dev);
875
860 return err; 876 return err;
861} 877}
862 878
@@ -974,7 +990,7 @@ struct net_device *rtnl_create_link(struct net *net, char *ifname,
974 if (tb[IFLA_TXQLEN]) 990 if (tb[IFLA_TXQLEN])
975 dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]); 991 dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
976 if (tb[IFLA_OPERSTATE]) 992 if (tb[IFLA_OPERSTATE])
977 set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE])); 993 set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]), true);
978 if (tb[IFLA_LINKMODE]) 994 if (tb[IFLA_LINKMODE])
979 dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]); 995 dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
980 996
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index cfc07dac636c..0d0fd28a9041 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2106,11 +2106,10 @@ int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb,
2106/** 2106/**
2107 * skb_pull_rcsum - pull skb and update receive checksum 2107 * skb_pull_rcsum - pull skb and update receive checksum
2108 * @skb: buffer to update 2108 * @skb: buffer to update
2109 * @start: start of data before pull
2110 * @len: length of data pulled 2109 * @len: length of data pulled
2111 * 2110 *
2112 * This function performs an skb_pull on the packet and updates 2111 * This function performs an skb_pull on the packet and updates
2113 * update the CHECKSUM_COMPLETE checksum. It should be used on 2112 * the CHECKSUM_COMPLETE checksum. It should be used on
2114 * receive path processing instead of skb_pull unless you know 2113 * receive path processing instead of skb_pull unless you know
2115 * that the checksum difference is zero (e.g., a valid IP header) 2114 * that the checksum difference is zero (e.g., a valid IP header)
2116 * or you are setting ip_summed to CHECKSUM_NONE. 2115 * or you are setting ip_summed to CHECKSUM_NONE.