aboutsummaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-19 07:52:45 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-19 07:52:45 -0800
commit07ce198a1eb3431d04a6d59ea9fb7b71f21e33b1 (patch)
treefe6e6208bdcdfb7bbb0c81923efcb75bf73a299b /net/core
parent4bc87e62775052aac0be7574d5f84ff06f61c6b4 (diff)
parenta442585952f137bd4cdb1f2f3166e4157d383b82 (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: (60 commits) [NIU]: Bump driver version and release date. [NIU]: Fix BMAC alternate MAC address indexing. net: fix kernel-doc warnings in header files [IPV6]: Use BUG_ON instead of if + BUG in fib6_del_route. [IPV6]: dst_entry leak in ip4ip6_err. (resend) bluetooth: do not move child device other than rfcomm bluetooth: put hci dev after del conn [NET]: Elminate spurious print_mac() calls. [BLUETOOTH] hci_sysfs.c: Kill build warning. [NET]: Remove MAC_FMT net/8021q/vlan_dev.c: Use print_mac. [XFRM]: Fix ordering issue in xfrm_dst_hash_transfer(). [BLUETOOTH] net/bluetooth/hci_core.c: Use time_* macros [IPV6]: Fix hardcoded removing of old module code [NETLABEL]: Move some initialization code into __init section. [NETLABEL]: Shrink the genl-ops registration code. [AX25] ax25_out: check skb for NULL in ax25_kick() [TCP]: Fix tcp_v4_send_synack() comment [IPV4]: fix alignment of IP-Config output Documentation: fix tcp.txt ...
Diffstat (limited to 'net/core')
-rw-r--r--net/core/neighbour.c12
-rw-r--r--net/core/rtnetlink.c36
2 files changed, 19 insertions, 29 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 7bb6a9a1256..a16cf1ec5e5 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -834,12 +834,18 @@ static void neigh_timer_handler(unsigned long arg)
}
if (neigh->nud_state & (NUD_INCOMPLETE | NUD_PROBE)) {
struct sk_buff *skb = skb_peek(&neigh->arp_queue);
-
+ /* keep skb alive even if arp_queue overflows */
+ if (skb)
+ skb_get(skb);
+ write_unlock(&neigh->lock);
neigh->ops->solicit(neigh, skb);
atomic_inc(&neigh->probes);
- }
+ if (skb)
+ kfree_skb(skb);
+ } else {
out:
- write_unlock(&neigh->lock);
+ write_unlock(&neigh->lock);
+ }
if (notify)
neigh_update_notify(neigh);
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index ecb02afd52d..61ac8d06292 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,
EXPORT_SYMBOL_GPL(rtnl_put_cacheinfo);
-static int set_operstate(struct net_device *dev, unsigned char transition, bool send_notification)
+static void set_operstate(struct net_device *dev, unsigned char transition)
{
unsigned char operstate = dev->operstate;
@@ -527,12 +527,8 @@ static int set_operstate(struct net_device *dev, unsigned char transition, bool
write_lock_bh(&dev_base_lock);
dev->operstate = operstate;
write_unlock_bh(&dev_base_lock);
-
- if (send_notification)
- netdev_state_change(dev);
- return 1;
- } else
- return 0;
+ netdev_state_change(dev);
+ }
}
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,
if (tb[IFLA_BROADCAST]) {
nla_memcpy(dev->broadcast, tb[IFLA_BROADCAST], dev->addr_len);
send_addr_notify = 1;
- modified = 1;
}
if (ifm->ifi_flags || ifm->ifi_change) {
@@ -839,23 +834,16 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
dev_change_flags(dev, flags);
}
- if (tb[IFLA_TXQLEN]) {
- if (dev->tx_queue_len != nla_get_u32(tb[IFLA_TXQLEN])) {
- dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
- modified = 1;
- }
- }
+ if (tb[IFLA_TXQLEN])
+ dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
if (tb[IFLA_OPERSTATE])
- modified |= set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]), false);
+ set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]));
if (tb[IFLA_LINKMODE]) {
- if (dev->link_mode != nla_get_u8(tb[IFLA_LINKMODE])) {
- write_lock_bh(&dev_base_lock);
- dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
- write_lock_bh(&dev_base_lock);
- modified = 1;
- }
+ write_lock_bh(&dev_base_lock);
+ dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]);
+ write_unlock_bh(&dev_base_lock);
}
err = 0;
@@ -869,10 +857,6 @@ errout:
if (send_addr_notify)
call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
-
- if (modified)
- netdev_state_change(dev);
-
return err;
}
@@ -990,7 +974,7 @@ struct net_device *rtnl_create_link(struct net *net, char *ifname,
if (tb[IFLA_TXQLEN])
dev->tx_queue_len = nla_get_u32(tb[IFLA_TXQLEN]);
if (tb[IFLA_OPERSTATE])
- set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]), true);
+ set_operstate(dev, nla_get_u8(tb[IFLA_OPERSTATE]));
if (tb[IFLA_LINKMODE])
dev->link_mode = nla_get_u8(tb[IFLA_LINKMODE]);