diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/802/tr.c | 5 | ||||
-rw-r--r-- | net/core/neighbour.c | 48 | ||||
-rw-r--r-- | net/core/skbuff.c | 6 | ||||
-rw-r--r-- | net/dccp/ipv4.c | 2 | ||||
-rw-r--r-- | net/dccp/output.c | 10 | ||||
-rw-r--r-- | net/dccp/proto.c | 2 | ||||
-rw-r--r-- | net/ipv4/ip_output.c | 3 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 12 | ||||
-rw-r--r-- | net/ipv6/ip6_flowlabel.c | 2 |
9 files changed, 37 insertions, 53 deletions
diff --git a/net/802/tr.c b/net/802/tr.c index 1eaa3d19d8bf..afd8385c0c9c 100644 --- a/net/802/tr.c +++ b/net/802/tr.c | |||
@@ -340,9 +340,10 @@ static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev) | |||
340 | unsigned int hash, rii_p = 0; | 340 | unsigned int hash, rii_p = 0; |
341 | unsigned long flags; | 341 | unsigned long flags; |
342 | struct rif_cache *entry; | 342 | struct rif_cache *entry; |
343 | 343 | unsigned char saddr0; | |
344 | 344 | ||
345 | spin_lock_irqsave(&rif_lock, flags); | 345 | spin_lock_irqsave(&rif_lock, flags); |
346 | saddr0 = trh->saddr[0]; | ||
346 | 347 | ||
347 | /* | 348 | /* |
348 | * Firstly see if the entry exists | 349 | * Firstly see if the entry exists |
@@ -395,7 +396,6 @@ printk("adding rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n", | |||
395 | entry->rcf = trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK); | 396 | entry->rcf = trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK); |
396 | memcpy(&(entry->rseg[0]),&(trh->rseg[0]),8*sizeof(unsigned short)); | 397 | memcpy(&(entry->rseg[0]),&(trh->rseg[0]),8*sizeof(unsigned short)); |
397 | entry->local_ring = 0; | 398 | entry->local_ring = 0; |
398 | trh->saddr[0]|=TR_RII; /* put the routing indicator back for tcpdump */ | ||
399 | } | 399 | } |
400 | else | 400 | else |
401 | { | 401 | { |
@@ -422,6 +422,7 @@ printk("updating rif_entry: addr:%02X:%02X:%02X:%02X:%02X:%02X rcf:%04X\n", | |||
422 | } | 422 | } |
423 | entry->last_used=jiffies; | 423 | entry->last_used=jiffies; |
424 | } | 424 | } |
425 | trh->saddr[0]=saddr0; /* put the routing indicator back for tcpdump */ | ||
425 | spin_unlock_irqrestore(&rif_lock, flags); | 426 | spin_unlock_irqrestore(&rif_lock, flags); |
426 | } | 427 | } |
427 | 428 | ||
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 4128fc76ac3a..1dcf7fa1f0fe 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -175,39 +175,10 @@ static void pneigh_queue_purge(struct sk_buff_head *list) | |||
175 | } | 175 | } |
176 | } | 176 | } |
177 | 177 | ||
178 | void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev) | 178 | static void neigh_flush_dev(struct neigh_table *tbl, struct net_device *dev) |
179 | { | 179 | { |
180 | int i; | 180 | int i; |
181 | 181 | ||
182 | write_lock_bh(&tbl->lock); | ||
183 | |||
184 | for (i=0; i <= tbl->hash_mask; i++) { | ||
185 | struct neighbour *n, **np; | ||
186 | |||
187 | np = &tbl->hash_buckets[i]; | ||
188 | while ((n = *np) != NULL) { | ||
189 | if (dev && n->dev != dev) { | ||
190 | np = &n->next; | ||
191 | continue; | ||
192 | } | ||
193 | *np = n->next; | ||
194 | write_lock_bh(&n->lock); | ||
195 | n->dead = 1; | ||
196 | neigh_del_timer(n); | ||
197 | write_unlock_bh(&n->lock); | ||
198 | neigh_release(n); | ||
199 | } | ||
200 | } | ||
201 | |||
202 | write_unlock_bh(&tbl->lock); | ||
203 | } | ||
204 | |||
205 | int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev) | ||
206 | { | ||
207 | int i; | ||
208 | |||
209 | write_lock_bh(&tbl->lock); | ||
210 | |||
211 | for (i = 0; i <= tbl->hash_mask; i++) { | 182 | for (i = 0; i <= tbl->hash_mask; i++) { |
212 | struct neighbour *n, **np = &tbl->hash_buckets[i]; | 183 | struct neighbour *n, **np = &tbl->hash_buckets[i]; |
213 | 184 | ||
@@ -243,7 +214,19 @@ int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev) | |||
243 | neigh_release(n); | 214 | neigh_release(n); |
244 | } | 215 | } |
245 | } | 216 | } |
217 | } | ||
246 | 218 | ||
219 | void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev) | ||
220 | { | ||
221 | write_lock_bh(&tbl->lock); | ||
222 | neigh_flush_dev(tbl, dev); | ||
223 | write_unlock_bh(&tbl->lock); | ||
224 | } | ||
225 | |||
226 | int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev) | ||
227 | { | ||
228 | write_lock_bh(&tbl->lock); | ||
229 | neigh_flush_dev(tbl, dev); | ||
247 | pneigh_ifdown(tbl, dev); | 230 | pneigh_ifdown(tbl, dev); |
248 | write_unlock_bh(&tbl->lock); | 231 | write_unlock_bh(&tbl->lock); |
249 | 232 | ||
@@ -732,6 +715,7 @@ static inline void neigh_add_timer(struct neighbour *n, unsigned long when) | |||
732 | if (unlikely(mod_timer(&n->timer, when))) { | 715 | if (unlikely(mod_timer(&n->timer, when))) { |
733 | printk("NEIGH: BUG, double timer add, state is %x\n", | 716 | printk("NEIGH: BUG, double timer add, state is %x\n", |
734 | n->nud_state); | 717 | n->nud_state); |
718 | dump_stack(); | ||
735 | } | 719 | } |
736 | } | 720 | } |
737 | 721 | ||
@@ -815,10 +799,10 @@ static void neigh_timer_handler(unsigned long arg) | |||
815 | } | 799 | } |
816 | 800 | ||
817 | if (neigh->nud_state & NUD_IN_TIMER) { | 801 | if (neigh->nud_state & NUD_IN_TIMER) { |
818 | neigh_hold(neigh); | ||
819 | if (time_before(next, jiffies + HZ/2)) | 802 | if (time_before(next, jiffies + HZ/2)) |
820 | next = jiffies + HZ/2; | 803 | next = jiffies + HZ/2; |
821 | neigh_add_timer(neigh, next); | 804 | if (!mod_timer(&neigh->timer, next)) |
805 | neigh_hold(neigh); | ||
822 | } | 806 | } |
823 | if (neigh->nud_state & (NUD_INCOMPLETE | NUD_PROBE)) { | 807 | if (neigh->nud_state & (NUD_INCOMPLETE | NUD_PROBE)) { |
824 | struct sk_buff *skb = skb_peek(&neigh->arp_queue); | 808 | struct sk_buff *skb = skb_peek(&neigh->arp_queue); |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index af9b1516e21f..02cd4cde2112 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -410,6 +410,9 @@ struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask) | |||
410 | C(nfct); | 410 | C(nfct); |
411 | nf_conntrack_get(skb->nfct); | 411 | nf_conntrack_get(skb->nfct); |
412 | C(nfctinfo); | 412 | C(nfctinfo); |
413 | #if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE) | ||
414 | C(ipvs_property); | ||
415 | #endif | ||
413 | #ifdef CONFIG_BRIDGE_NETFILTER | 416 | #ifdef CONFIG_BRIDGE_NETFILTER |
414 | C(nf_bridge); | 417 | C(nf_bridge); |
415 | nf_bridge_get(skb->nf_bridge); | 418 | nf_bridge_get(skb->nf_bridge); |
@@ -467,6 +470,9 @@ static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old) | |||
467 | new->nfct = old->nfct; | 470 | new->nfct = old->nfct; |
468 | nf_conntrack_get(old->nfct); | 471 | nf_conntrack_get(old->nfct); |
469 | new->nfctinfo = old->nfctinfo; | 472 | new->nfctinfo = old->nfctinfo; |
473 | #if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE) | ||
474 | new->ipvs_property = old->ipvs_property; | ||
475 | #endif | ||
470 | #ifdef CONFIG_BRIDGE_NETFILTER | 476 | #ifdef CONFIG_BRIDGE_NETFILTER |
471 | new->nf_bridge = old->nf_bridge; | 477 | new->nf_bridge = old->nf_bridge; |
472 | nf_bridge_get(old->nf_bridge); | 478 | nf_bridge_get(old->nf_bridge); |
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index ae088d1347af..6298cf58ff9e 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -463,6 +463,7 @@ static int dccp_v4_send_response(struct sock *sk, struct request_sock *req, | |||
463 | if (skb != NULL) { | 463 | if (skb != NULL) { |
464 | const struct inet_request_sock *ireq = inet_rsk(req); | 464 | const struct inet_request_sock *ireq = inet_rsk(req); |
465 | 465 | ||
466 | memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); | ||
466 | err = ip_build_and_send_pkt(skb, sk, ireq->loc_addr, | 467 | err = ip_build_and_send_pkt(skb, sk, ireq->loc_addr, |
467 | ireq->rmt_addr, | 468 | ireq->rmt_addr, |
468 | ireq->opt); | 469 | ireq->opt); |
@@ -647,6 +648,7 @@ int dccp_v4_send_reset(struct sock *sk, enum dccp_reset_codes code) | |||
647 | if (skb != NULL) { | 648 | if (skb != NULL) { |
648 | const struct inet_sock *inet = inet_sk(sk); | 649 | const struct inet_sock *inet = inet_sk(sk); |
649 | 650 | ||
651 | memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); | ||
650 | err = ip_build_and_send_pkt(skb, sk, | 652 | err = ip_build_and_send_pkt(skb, sk, |
651 | inet->saddr, inet->daddr, NULL); | 653 | inet->saddr, inet->daddr, NULL); |
652 | if (err == NET_XMIT_CN) | 654 | if (err == NET_XMIT_CN) |
diff --git a/net/dccp/output.c b/net/dccp/output.c index 4786bdcddcc9..29250749f16f 100644 --- a/net/dccp/output.c +++ b/net/dccp/output.c | |||
@@ -62,10 +62,8 @@ int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb) | |||
62 | 62 | ||
63 | skb->h.raw = skb_push(skb, dccp_header_size); | 63 | skb->h.raw = skb_push(skb, dccp_header_size); |
64 | dh = dccp_hdr(skb); | 64 | dh = dccp_hdr(skb); |
65 | /* | 65 | |
66 | * Data packets are not cloned as they are never retransmitted | 66 | if (!skb->sk) |
67 | */ | ||
68 | if (skb_cloned(skb)) | ||
69 | skb_set_owner_w(skb, sk); | 67 | skb_set_owner_w(skb, sk); |
70 | 68 | ||
71 | /* Build DCCP header and checksum it. */ | 69 | /* Build DCCP header and checksum it. */ |
@@ -102,6 +100,7 @@ int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb) | |||
102 | 100 | ||
103 | DCCP_INC_STATS(DCCP_MIB_OUTSEGS); | 101 | DCCP_INC_STATS(DCCP_MIB_OUTSEGS); |
104 | 102 | ||
103 | memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); | ||
105 | err = ip_queue_xmit(skb, 0); | 104 | err = ip_queue_xmit(skb, 0); |
106 | if (err <= 0) | 105 | if (err <= 0) |
107 | return err; | 106 | return err; |
@@ -243,7 +242,8 @@ int dccp_write_xmit(struct sock *sk, struct sk_buff *skb, long *timeo) | |||
243 | 242 | ||
244 | err = dccp_transmit_skb(sk, skb); | 243 | err = dccp_transmit_skb(sk, skb); |
245 | ccid_hc_tx_packet_sent(dp->dccps_hc_tx_ccid, sk, 0, len); | 244 | ccid_hc_tx_packet_sent(dp->dccps_hc_tx_ccid, sk, 0, len); |
246 | } | 245 | } else |
246 | kfree_skb(skb); | ||
247 | 247 | ||
248 | return err; | 248 | return err; |
249 | } | 249 | } |
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index a1cfd0e9e3bc..a021c3422f67 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
@@ -402,8 +402,6 @@ int dccp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
402 | * This bug was _quickly_ found & fixed by just looking at an OSTRA | 402 | * This bug was _quickly_ found & fixed by just looking at an OSTRA |
403 | * generated callgraph 8) -acme | 403 | * generated callgraph 8) -acme |
404 | */ | 404 | */ |
405 | if (rc != 0) | ||
406 | goto out_discard; | ||
407 | out_release: | 405 | out_release: |
408 | release_sock(sk); | 406 | release_sock(sk); |
409 | return rc ? : len; | 407 | return rc ? : len; |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 3f1a263e1249..1ad5202e556b 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -391,6 +391,9 @@ static void ip_copy_metadata(struct sk_buff *to, struct sk_buff *from) | |||
391 | to->nfct = from->nfct; | 391 | to->nfct = from->nfct; |
392 | nf_conntrack_get(to->nfct); | 392 | nf_conntrack_get(to->nfct); |
393 | to->nfctinfo = from->nfctinfo; | 393 | to->nfctinfo = from->nfctinfo; |
394 | #if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE) | ||
395 | to->ipvs_property = from->ipvs_property; | ||
396 | #endif | ||
394 | #ifdef CONFIG_BRIDGE_NETFILTER | 397 | #ifdef CONFIG_BRIDGE_NETFILTER |
395 | nf_bridge_put(to->nf_bridge); | 398 | nf_bridge_put(to->nf_bridge); |
396 | to->nf_bridge = from->nf_bridge; | 399 | to->nf_bridge = from->nf_bridge; |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 7114031fdc70..b907456a79f4 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -435,17 +435,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss | |||
435 | int nsize, old_factor; | 435 | int nsize, old_factor; |
436 | u16 flags; | 436 | u16 flags; |
437 | 437 | ||
438 | if (unlikely(len >= skb->len)) { | 438 | BUG_ON(len > skb->len); |
439 | if (net_ratelimit()) { | ||
440 | printk(KERN_DEBUG "TCP: seg_size=%u, mss=%u, seq=%u, " | ||
441 | "end_seq=%u, skb->len=%u.\n", len, mss_now, | ||
442 | TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq, | ||
443 | skb->len); | ||
444 | WARN_ON(1); | ||
445 | } | ||
446 | return 0; | ||
447 | } | ||
448 | |||
449 | nsize = skb_headlen(skb) - len; | 439 | nsize = skb_headlen(skb) - len; |
450 | if (nsize < 0) | 440 | if (nsize < 0) |
451 | nsize = 0; | 441 | nsize = 0; |
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c index f841bde30c18..bbbe80cdaf72 100644 --- a/net/ipv6/ip6_flowlabel.c +++ b/net/ipv6/ip6_flowlabel.c | |||
@@ -483,7 +483,7 @@ int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen) | |||
483 | goto done; | 483 | goto done; |
484 | } | 484 | } |
485 | fl1 = sfl->fl; | 485 | fl1 = sfl->fl; |
486 | atomic_inc(&fl->users); | 486 | atomic_inc(&fl1->users); |
487 | break; | 487 | break; |
488 | } | 488 | } |
489 | } | 489 | } |