diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-08-09 14:49:13 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-08-09 14:49:13 -0400 |
commit | a4657141091c2f975fa35ac1ad28fffdd756091e (patch) | |
tree | d284f416d2ffb21d5cb3a74843a9ab976ec32193 /net/core | |
parent | 54f58d6c4f15f3bdf15d43fa640ca6de9487f50e (diff) | |
parent | 7c91767a6b701543c93ebcd611dab61deff3dad1 (diff) |
Merge gregkh@master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/dst.c | 3 | ||||
-rw-r--r-- | net/core/pktgen.c | 4 | ||||
-rw-r--r-- | net/core/rtnetlink.c | 15 | ||||
-rw-r--r-- | net/core/skbuff.c | 4 |
4 files changed, 22 insertions, 4 deletions
diff --git a/net/core/dst.c b/net/core/dst.c index 470c05bc4cb2..1a5e49da0e77 100644 --- a/net/core/dst.c +++ b/net/core/dst.c | |||
@@ -95,12 +95,11 @@ static void dst_run_gc(unsigned long dummy) | |||
95 | dst_gc_timer_inc = DST_GC_INC; | 95 | dst_gc_timer_inc = DST_GC_INC; |
96 | dst_gc_timer_expires = DST_GC_MIN; | 96 | dst_gc_timer_expires = DST_GC_MIN; |
97 | } | 97 | } |
98 | dst_gc_timer.expires = jiffies + dst_gc_timer_expires; | ||
99 | #if RT_CACHE_DEBUG >= 2 | 98 | #if RT_CACHE_DEBUG >= 2 |
100 | printk("dst_total: %d/%d %ld\n", | 99 | printk("dst_total: %d/%d %ld\n", |
101 | atomic_read(&dst_total), delayed, dst_gc_timer_expires); | 100 | atomic_read(&dst_total), delayed, dst_gc_timer_expires); |
102 | #endif | 101 | #endif |
103 | add_timer(&dst_gc_timer); | 102 | mod_timer(&dst_gc_timer, jiffies + dst_gc_timer_expires); |
104 | 103 | ||
105 | out: | 104 | out: |
106 | spin_unlock(&dst_lock); | 105 | spin_unlock(&dst_lock); |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 67ed14ddabd2..6a7320b39ed0 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -2149,6 +2149,8 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev, | |||
2149 | skb->mac.raw = ((u8 *) iph) - 14 - pkt_dev->nr_labels*sizeof(u32); | 2149 | skb->mac.raw = ((u8 *) iph) - 14 - pkt_dev->nr_labels*sizeof(u32); |
2150 | skb->dev = odev; | 2150 | skb->dev = odev; |
2151 | skb->pkt_type = PACKET_HOST; | 2151 | skb->pkt_type = PACKET_HOST; |
2152 | skb->nh.iph = iph; | ||
2153 | skb->h.uh = udph; | ||
2152 | 2154 | ||
2153 | if (pkt_dev->nfrags <= 0) | 2155 | if (pkt_dev->nfrags <= 0) |
2154 | pgh = (struct pktgen_hdr *)skb_put(skb, datalen); | 2156 | pgh = (struct pktgen_hdr *)skb_put(skb, datalen); |
@@ -2460,6 +2462,8 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev, | |||
2460 | skb->protocol = protocol; | 2462 | skb->protocol = protocol; |
2461 | skb->dev = odev; | 2463 | skb->dev = odev; |
2462 | skb->pkt_type = PACKET_HOST; | 2464 | skb->pkt_type = PACKET_HOST; |
2465 | skb->nh.ipv6h = iph; | ||
2466 | skb->h.uh = udph; | ||
2463 | 2467 | ||
2464 | if (pkt_dev->nfrags <= 0) | 2468 | if (pkt_dev->nfrags <= 0) |
2465 | pgh = (struct pktgen_hdr *)skb_put(skb, datalen); | 2469 | pgh = (struct pktgen_hdr *)skb_put(skb, datalen); |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 20e5bb73f147..30cc1ba6ed5c 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -394,6 +394,9 @@ static int do_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | |||
394 | } | 394 | } |
395 | 395 | ||
396 | if (ida[IFLA_ADDRESS - 1]) { | 396 | if (ida[IFLA_ADDRESS - 1]) { |
397 | struct sockaddr *sa; | ||
398 | int len; | ||
399 | |||
397 | if (!dev->set_mac_address) { | 400 | if (!dev->set_mac_address) { |
398 | err = -EOPNOTSUPP; | 401 | err = -EOPNOTSUPP; |
399 | goto out; | 402 | goto out; |
@@ -405,7 +408,17 @@ static int do_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | |||
405 | if (ida[IFLA_ADDRESS - 1]->rta_len != RTA_LENGTH(dev->addr_len)) | 408 | if (ida[IFLA_ADDRESS - 1]->rta_len != RTA_LENGTH(dev->addr_len)) |
406 | goto out; | 409 | goto out; |
407 | 410 | ||
408 | err = dev->set_mac_address(dev, RTA_DATA(ida[IFLA_ADDRESS - 1])); | 411 | len = sizeof(sa_family_t) + dev->addr_len; |
412 | sa = kmalloc(len, GFP_KERNEL); | ||
413 | if (!sa) { | ||
414 | err = -ENOMEM; | ||
415 | goto out; | ||
416 | } | ||
417 | sa->sa_family = dev->type; | ||
418 | memcpy(sa->sa_data, RTA_DATA(ida[IFLA_ADDRESS - 1]), | ||
419 | dev->addr_len); | ||
420 | err = dev->set_mac_address(dev, sa); | ||
421 | kfree(sa); | ||
409 | if (err) | 422 | if (err) |
410 | goto out; | 423 | goto out; |
411 | send_addr_notify = 1; | 424 | send_addr_notify = 1; |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 022d8894c11d..c54f3664bce5 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -268,8 +268,10 @@ struct sk_buff *__netdev_alloc_skb(struct net_device *dev, | |||
268 | struct sk_buff *skb; | 268 | struct sk_buff *skb; |
269 | 269 | ||
270 | skb = alloc_skb(length + NET_SKB_PAD, gfp_mask); | 270 | skb = alloc_skb(length + NET_SKB_PAD, gfp_mask); |
271 | if (likely(skb)) | 271 | if (likely(skb)) { |
272 | skb_reserve(skb, NET_SKB_PAD); | 272 | skb_reserve(skb, NET_SKB_PAD); |
273 | skb->dev = dev; | ||
274 | } | ||
273 | return skb; | 275 | return skb; |
274 | } | 276 | } |
275 | 277 | ||