diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-26 23:09:07 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-26 23:09:07 -0500 |
commit | 8c27eba54970c6ebbb408186e5baa2274435e869 (patch) | |
tree | 47348cfc4c008692eee4a9174fcc6d8b20f5e647 /net | |
parent | 8912858bcb9e314549a4abc15db6b5841a96fa2c (diff) | |
parent | 5dba4797115c8fa05c1a4d12927a6ae0b33ffc41 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/net-2.6: (41 commits)
[XFRM]: Fix leak of expired xfrm_states
[ATM]: [he] initialize lock and tasklet earlier
[IPV4]: Remove bogus ifdef mess in arp_process
[SKBUFF]: Free old skb properly in skb_morph
[IPV4]: Fix memory leak in inet_hashtables.h when NUMA is on
[IPSEC]: Temporarily remove locks around copying of non-atomic fields
[TCP] MTUprobe: Cleanup send queue check (no need to loop)
[TCP]: MTUprobe: receiver window & data available checks fixed
[MAINTAINERS]: tlan list is subscribers-only
[SUNRPC]: Remove SPIN_LOCK_UNLOCKED
[SUNRPC]: Make xprtsock.c:xs_setup_{udp,tcp}() static
[PFKEY]: Sending an SADB_GET responds with an SADB_GET
[IRDA]: Compilation for CONFIG_INET=n case
[IPVS]: Fix compiler warning about unused register_ip_vs_protocol
[ARP]: Fix arp reply when sender ip 0
[IPV6] TCPMD5: Fix deleting key operation.
[IPV6] TCPMD5: Check return value of tcp_alloc_md5sig_pool().
[IPV4] TCPMD5: Use memmove() instead of memcpy() because we have overlaps.
[IPV4] TCPMD5: Omit redundant NULL check for kfree() argument.
ieee80211: Stop net_ratelimit/IEEE80211_DEBUG_DROP log pollution
...
Diffstat (limited to 'net')
30 files changed, 84 insertions, 122 deletions
diff --git a/net/bridge/netfilter/ebt_among.c b/net/bridge/netfilter/ebt_among.c index 392d877040d3..6436d30a550e 100644 --- a/net/bridge/netfilter/ebt_among.c +++ b/net/bridge/netfilter/ebt_among.c | |||
@@ -187,7 +187,7 @@ static int ebt_among_check(const char *tablename, unsigned int hookmask, | |||
187 | 187 | ||
188 | if (datalen != EBT_ALIGN(expected_length)) { | 188 | if (datalen != EBT_ALIGN(expected_length)) { |
189 | printk(KERN_WARNING | 189 | printk(KERN_WARNING |
190 | "ebtables: among: wrong size: %d" | 190 | "ebtables: among: wrong size: %d " |
191 | "against expected %d, rounded to %Zd\n", | 191 | "against expected %d, rounded to %Zd\n", |
192 | datalen, expected_length, | 192 | datalen, expected_length, |
193 | EBT_ALIGN(expected_length)); | 193 | EBT_ALIGN(expected_length)); |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index de33f36947e9..285ec3ed9b37 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -2463,8 +2463,6 @@ static int pktgen_output_ipsec(struct sk_buff *skb, struct pktgen_dev *pkt_dev) | |||
2463 | 2463 | ||
2464 | x->curlft.bytes +=skb->len; | 2464 | x->curlft.bytes +=skb->len; |
2465 | x->curlft.packets++; | 2465 | x->curlft.packets++; |
2466 | spin_unlock(&x->lock); | ||
2467 | |||
2468 | error: | 2466 | error: |
2469 | spin_unlock(&x->lock); | 2467 | spin_unlock(&x->lock); |
2470 | return err; | 2468 | return err; |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 32d5826b7177..5b4ce9b4dd20 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -275,12 +275,11 @@ static void skb_release_data(struct sk_buff *skb) | |||
275 | /* | 275 | /* |
276 | * Free an skbuff by memory without cleaning the state. | 276 | * Free an skbuff by memory without cleaning the state. |
277 | */ | 277 | */ |
278 | void kfree_skbmem(struct sk_buff *skb) | 278 | static void kfree_skbmem(struct sk_buff *skb) |
279 | { | 279 | { |
280 | struct sk_buff *other; | 280 | struct sk_buff *other; |
281 | atomic_t *fclone_ref; | 281 | atomic_t *fclone_ref; |
282 | 282 | ||
283 | skb_release_data(skb); | ||
284 | switch (skb->fclone) { | 283 | switch (skb->fclone) { |
285 | case SKB_FCLONE_UNAVAILABLE: | 284 | case SKB_FCLONE_UNAVAILABLE: |
286 | kmem_cache_free(skbuff_head_cache, skb); | 285 | kmem_cache_free(skbuff_head_cache, skb); |
@@ -307,16 +306,8 @@ void kfree_skbmem(struct sk_buff *skb) | |||
307 | } | 306 | } |
308 | } | 307 | } |
309 | 308 | ||
310 | /** | 309 | /* Free everything but the sk_buff shell. */ |
311 | * __kfree_skb - private function | 310 | static void skb_release_all(struct sk_buff *skb) |
312 | * @skb: buffer | ||
313 | * | ||
314 | * Free an sk_buff. Release anything attached to the buffer. | ||
315 | * Clean the state. This is an internal helper function. Users should | ||
316 | * always call kfree_skb | ||
317 | */ | ||
318 | |||
319 | void __kfree_skb(struct sk_buff *skb) | ||
320 | { | 311 | { |
321 | dst_release(skb->dst); | 312 | dst_release(skb->dst); |
322 | #ifdef CONFIG_XFRM | 313 | #ifdef CONFIG_XFRM |
@@ -340,7 +331,21 @@ void __kfree_skb(struct sk_buff *skb) | |||
340 | skb->tc_verd = 0; | 331 | skb->tc_verd = 0; |
341 | #endif | 332 | #endif |
342 | #endif | 333 | #endif |
334 | skb_release_data(skb); | ||
335 | } | ||
336 | |||
337 | /** | ||
338 | * __kfree_skb - private function | ||
339 | * @skb: buffer | ||
340 | * | ||
341 | * Free an sk_buff. Release anything attached to the buffer. | ||
342 | * Clean the state. This is an internal helper function. Users should | ||
343 | * always call kfree_skb | ||
344 | */ | ||
343 | 345 | ||
346 | void __kfree_skb(struct sk_buff *skb) | ||
347 | { | ||
348 | skb_release_all(skb); | ||
344 | kfree_skbmem(skb); | 349 | kfree_skbmem(skb); |
345 | } | 350 | } |
346 | 351 | ||
@@ -441,7 +446,7 @@ static struct sk_buff *__skb_clone(struct sk_buff *n, struct sk_buff *skb) | |||
441 | */ | 446 | */ |
442 | struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src) | 447 | struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src) |
443 | { | 448 | { |
444 | skb_release_data(dst); | 449 | skb_release_all(dst); |
445 | return __skb_clone(dst, src); | 450 | return __skb_clone(dst, src); |
446 | } | 451 | } |
447 | EXPORT_SYMBOL_GPL(skb_morph); | 452 | EXPORT_SYMBOL_GPL(skb_morph); |
diff --git a/net/dccp/ccids/lib/loss_interval.c b/net/dccp/ccids/lib/loss_interval.c index 40ad428a27f5..d26b88dbbb45 100644 --- a/net/dccp/ccids/lib/loss_interval.c +++ b/net/dccp/ccids/lib/loss_interval.c | |||
@@ -166,7 +166,7 @@ static u32 dccp_li_calc_first_li(struct sock *sk, | |||
166 | } | 166 | } |
167 | 167 | ||
168 | if (unlikely(interval == 0)) { | 168 | if (unlikely(interval == 0)) { |
169 | DCCP_WARN("%s(%p), Could not find a win_count interval > 0." | 169 | DCCP_WARN("%s(%p), Could not find a win_count interval > 0. " |
170 | "Defaulting to 1\n", dccp_role(sk), sk); | 170 | "Defaulting to 1\n", dccp_role(sk), sk); |
171 | interval = 1; | 171 | interval = 1; |
172 | } | 172 | } |
diff --git a/net/ieee80211/ieee80211_crypt_ccmp.c b/net/ieee80211/ieee80211_crypt_ccmp.c index c6d760d9fbbe..208bf35b5546 100644 --- a/net/ieee80211/ieee80211_crypt_ccmp.c +++ b/net/ieee80211/ieee80211_crypt_ccmp.c | |||
@@ -338,7 +338,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
338 | pos += 8; | 338 | pos += 8; |
339 | 339 | ||
340 | if (ccmp_replay_check(pn, key->rx_pn)) { | 340 | if (ccmp_replay_check(pn, key->rx_pn)) { |
341 | if (net_ratelimit()) { | 341 | if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) { |
342 | IEEE80211_DEBUG_DROP("CCMP: replay detected: STA=%s " | 342 | IEEE80211_DEBUG_DROP("CCMP: replay detected: STA=%s " |
343 | "previous PN %02x%02x%02x%02x%02x%02x " | 343 | "previous PN %02x%02x%02x%02x%02x%02x " |
344 | "received PN %02x%02x%02x%02x%02x%02x\n", | 344 | "received PN %02x%02x%02x%02x%02x%02x\n", |
diff --git a/net/ieee80211/ieee80211_crypt_tkip.c b/net/ieee80211/ieee80211_crypt_tkip.c index 58b22619ab15..8e146949fc6f 100644 --- a/net/ieee80211/ieee80211_crypt_tkip.c +++ b/net/ieee80211/ieee80211_crypt_tkip.c | |||
@@ -464,7 +464,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
464 | pos += 8; | 464 | pos += 8; |
465 | 465 | ||
466 | if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) { | 466 | if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) { |
467 | if (net_ratelimit()) { | 467 | if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) { |
468 | IEEE80211_DEBUG_DROP("TKIP: replay detected: STA=%s" | 468 | IEEE80211_DEBUG_DROP("TKIP: replay detected: STA=%s" |
469 | " previous TSC %08x%04x received TSC " | 469 | " previous TSC %08x%04x received TSC " |
470 | "%08x%04x\n", print_mac(mac, hdr->addr2), | 470 | "%08x%04x\n", print_mac(mac, hdr->addr2), |
@@ -504,7 +504,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
504 | * it needs to be recalculated for the next packet. */ | 504 | * it needs to be recalculated for the next packet. */ |
505 | tkey->rx_phase1_done = 0; | 505 | tkey->rx_phase1_done = 0; |
506 | } | 506 | } |
507 | if (net_ratelimit()) { | 507 | if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) { |
508 | IEEE80211_DEBUG_DROP("TKIP: ICV error detected: STA=" | 508 | IEEE80211_DEBUG_DROP("TKIP: ICV error detected: STA=" |
509 | "%s\n", print_mac(mac, hdr->addr2)); | 509 | "%s\n", print_mac(mac, hdr->addr2)); |
510 | } | 510 | } |
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 36d6798947b5..b3f366a33a5c 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -111,12 +111,8 @@ | |||
111 | #include <net/tcp.h> | 111 | #include <net/tcp.h> |
112 | #include <net/sock.h> | 112 | #include <net/sock.h> |
113 | #include <net/arp.h> | 113 | #include <net/arp.h> |
114 | #if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) | ||
115 | #include <net/ax25.h> | 114 | #include <net/ax25.h> |
116 | #if defined(CONFIG_NETROM) || defined(CONFIG_NETROM_MODULE) | ||
117 | #include <net/netrom.h> | 115 | #include <net/netrom.h> |
118 | #endif | ||
119 | #endif | ||
120 | #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) | 116 | #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) |
121 | #include <net/atmclip.h> | 117 | #include <net/atmclip.h> |
122 | struct neigh_table *clip_tbl_hook; | 118 | struct neigh_table *clip_tbl_hook; |
@@ -731,20 +727,10 @@ static int arp_process(struct sk_buff *skb) | |||
731 | htons(dev_type) != arp->ar_hrd) | 727 | htons(dev_type) != arp->ar_hrd) |
732 | goto out; | 728 | goto out; |
733 | break; | 729 | break; |
734 | #ifdef CONFIG_NET_ETHERNET | ||
735 | case ARPHRD_ETHER: | 730 | case ARPHRD_ETHER: |
736 | #endif | ||
737 | #ifdef CONFIG_TR | ||
738 | case ARPHRD_IEEE802_TR: | 731 | case ARPHRD_IEEE802_TR: |
739 | #endif | ||
740 | #ifdef CONFIG_FDDI | ||
741 | case ARPHRD_FDDI: | 732 | case ARPHRD_FDDI: |
742 | #endif | ||
743 | #ifdef CONFIG_NET_FC | ||
744 | case ARPHRD_IEEE802: | 733 | case ARPHRD_IEEE802: |
745 | #endif | ||
746 | #if defined(CONFIG_NET_ETHERNET) || defined(CONFIG_TR) || \ | ||
747 | defined(CONFIG_FDDI) || defined(CONFIG_NET_FC) | ||
748 | /* | 734 | /* |
749 | * ETHERNET, Token Ring and Fibre Channel (which are IEEE 802 | 735 | * ETHERNET, Token Ring and Fibre Channel (which are IEEE 802 |
750 | * devices, according to RFC 2625) devices will accept ARP | 736 | * devices, according to RFC 2625) devices will accept ARP |
@@ -759,21 +745,16 @@ static int arp_process(struct sk_buff *skb) | |||
759 | arp->ar_pro != htons(ETH_P_IP)) | 745 | arp->ar_pro != htons(ETH_P_IP)) |
760 | goto out; | 746 | goto out; |
761 | break; | 747 | break; |
762 | #endif | ||
763 | #if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) | ||
764 | case ARPHRD_AX25: | 748 | case ARPHRD_AX25: |
765 | if (arp->ar_pro != htons(AX25_P_IP) || | 749 | if (arp->ar_pro != htons(AX25_P_IP) || |
766 | arp->ar_hrd != htons(ARPHRD_AX25)) | 750 | arp->ar_hrd != htons(ARPHRD_AX25)) |
767 | goto out; | 751 | goto out; |
768 | break; | 752 | break; |
769 | #if defined(CONFIG_NETROM) || defined(CONFIG_NETROM_MODULE) | ||
770 | case ARPHRD_NETROM: | 753 | case ARPHRD_NETROM: |
771 | if (arp->ar_pro != htons(AX25_P_IP) || | 754 | if (arp->ar_pro != htons(AX25_P_IP) || |
772 | arp->ar_hrd != htons(ARPHRD_NETROM)) | 755 | arp->ar_hrd != htons(ARPHRD_NETROM)) |
773 | goto out; | 756 | goto out; |
774 | break; | 757 | break; |
775 | #endif | ||
776 | #endif | ||
777 | } | 758 | } |
778 | 759 | ||
779 | /* Understand only these message types */ | 760 | /* Understand only these message types */ |
@@ -828,7 +809,8 @@ static int arp_process(struct sk_buff *skb) | |||
828 | if (arp->ar_op == htons(ARPOP_REQUEST) && | 809 | if (arp->ar_op == htons(ARPOP_REQUEST) && |
829 | inet_addr_type(tip) == RTN_LOCAL && | 810 | inet_addr_type(tip) == RTN_LOCAL && |
830 | !arp_ignore(in_dev,dev,sip,tip)) | 811 | !arp_ignore(in_dev,dev,sip,tip)) |
831 | arp_send(ARPOP_REPLY,ETH_P_ARP,tip,dev,tip,sha,dev->dev_addr,dev->dev_addr); | 812 | arp_send(ARPOP_REPLY, ETH_P_ARP, sip, dev, tip, sha, |
813 | dev->dev_addr, sha); | ||
832 | goto out; | 814 | goto out; |
833 | } | 815 | } |
834 | 816 | ||
diff --git a/net/ipv4/ipvs/ip_vs_core.c b/net/ipv4/ipvs/ip_vs_core.c index 20c884a57721..8fba20256f52 100644 --- a/net/ipv4/ipvs/ip_vs_core.c +++ b/net/ipv4/ipvs/ip_vs_core.c | |||
@@ -637,7 +637,7 @@ static int ip_vs_out_icmp(struct sk_buff *skb, int *related) | |||
637 | verdict = NF_DROP; | 637 | verdict = NF_DROP; |
638 | 638 | ||
639 | if (IP_VS_FWD_METHOD(cp) != 0) { | 639 | if (IP_VS_FWD_METHOD(cp) != 0) { |
640 | IP_VS_ERR("shouldn't reach here, because the box is on the" | 640 | IP_VS_ERR("shouldn't reach here, because the box is on the " |
641 | "half connection in the tun/dr module.\n"); | 641 | "half connection in the tun/dr module.\n"); |
642 | } | 642 | } |
643 | 643 | ||
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c index b64cf45a9ead..693d92490c11 100644 --- a/net/ipv4/ipvs/ip_vs_ctl.c +++ b/net/ipv4/ipvs/ip_vs_ctl.c | |||
@@ -1424,7 +1424,6 @@ proc_do_sync_threshold(ctl_table *table, int write, struct file *filp, | |||
1424 | 1424 | ||
1425 | static struct ctl_table vs_vars[] = { | 1425 | static struct ctl_table vs_vars[] = { |
1426 | { | 1426 | { |
1427 | .ctl_name = NET_IPV4_VS_AMEMTHRESH, | ||
1428 | .procname = "amemthresh", | 1427 | .procname = "amemthresh", |
1429 | .data = &sysctl_ip_vs_amemthresh, | 1428 | .data = &sysctl_ip_vs_amemthresh, |
1430 | .maxlen = sizeof(int), | 1429 | .maxlen = sizeof(int), |
@@ -1433,7 +1432,6 @@ static struct ctl_table vs_vars[] = { | |||
1433 | }, | 1432 | }, |
1434 | #ifdef CONFIG_IP_VS_DEBUG | 1433 | #ifdef CONFIG_IP_VS_DEBUG |
1435 | { | 1434 | { |
1436 | .ctl_name = NET_IPV4_VS_DEBUG_LEVEL, | ||
1437 | .procname = "debug_level", | 1435 | .procname = "debug_level", |
1438 | .data = &sysctl_ip_vs_debug_level, | 1436 | .data = &sysctl_ip_vs_debug_level, |
1439 | .maxlen = sizeof(int), | 1437 | .maxlen = sizeof(int), |
@@ -1442,7 +1440,6 @@ static struct ctl_table vs_vars[] = { | |||
1442 | }, | 1440 | }, |
1443 | #endif | 1441 | #endif |
1444 | { | 1442 | { |
1445 | .ctl_name = NET_IPV4_VS_AMDROPRATE, | ||
1446 | .procname = "am_droprate", | 1443 | .procname = "am_droprate", |
1447 | .data = &sysctl_ip_vs_am_droprate, | 1444 | .data = &sysctl_ip_vs_am_droprate, |
1448 | .maxlen = sizeof(int), | 1445 | .maxlen = sizeof(int), |
@@ -1450,7 +1447,6 @@ static struct ctl_table vs_vars[] = { | |||
1450 | .proc_handler = &proc_dointvec, | 1447 | .proc_handler = &proc_dointvec, |
1451 | }, | 1448 | }, |
1452 | { | 1449 | { |
1453 | .ctl_name = NET_IPV4_VS_DROP_ENTRY, | ||
1454 | .procname = "drop_entry", | 1450 | .procname = "drop_entry", |
1455 | .data = &sysctl_ip_vs_drop_entry, | 1451 | .data = &sysctl_ip_vs_drop_entry, |
1456 | .maxlen = sizeof(int), | 1452 | .maxlen = sizeof(int), |
@@ -1458,7 +1454,6 @@ static struct ctl_table vs_vars[] = { | |||
1458 | .proc_handler = &proc_do_defense_mode, | 1454 | .proc_handler = &proc_do_defense_mode, |
1459 | }, | 1455 | }, |
1460 | { | 1456 | { |
1461 | .ctl_name = NET_IPV4_VS_DROP_PACKET, | ||
1462 | .procname = "drop_packet", | 1457 | .procname = "drop_packet", |
1463 | .data = &sysctl_ip_vs_drop_packet, | 1458 | .data = &sysctl_ip_vs_drop_packet, |
1464 | .maxlen = sizeof(int), | 1459 | .maxlen = sizeof(int), |
@@ -1466,7 +1461,6 @@ static struct ctl_table vs_vars[] = { | |||
1466 | .proc_handler = &proc_do_defense_mode, | 1461 | .proc_handler = &proc_do_defense_mode, |
1467 | }, | 1462 | }, |
1468 | { | 1463 | { |
1469 | .ctl_name = NET_IPV4_VS_SECURE_TCP, | ||
1470 | .procname = "secure_tcp", | 1464 | .procname = "secure_tcp", |
1471 | .data = &sysctl_ip_vs_secure_tcp, | 1465 | .data = &sysctl_ip_vs_secure_tcp, |
1472 | .maxlen = sizeof(int), | 1466 | .maxlen = sizeof(int), |
@@ -1475,7 +1469,6 @@ static struct ctl_table vs_vars[] = { | |||
1475 | }, | 1469 | }, |
1476 | #if 0 | 1470 | #if 0 |
1477 | { | 1471 | { |
1478 | .ctl_name = NET_IPV4_VS_TO_ES, | ||
1479 | .procname = "timeout_established", | 1472 | .procname = "timeout_established", |
1480 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_ESTABLISHED], | 1473 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_ESTABLISHED], |
1481 | .maxlen = sizeof(int), | 1474 | .maxlen = sizeof(int), |
@@ -1483,7 +1476,6 @@ static struct ctl_table vs_vars[] = { | |||
1483 | .proc_handler = &proc_dointvec_jiffies, | 1476 | .proc_handler = &proc_dointvec_jiffies, |
1484 | }, | 1477 | }, |
1485 | { | 1478 | { |
1486 | .ctl_name = NET_IPV4_VS_TO_SS, | ||
1487 | .procname = "timeout_synsent", | 1479 | .procname = "timeout_synsent", |
1488 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_SYN_SENT], | 1480 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_SYN_SENT], |
1489 | .maxlen = sizeof(int), | 1481 | .maxlen = sizeof(int), |
@@ -1491,7 +1483,6 @@ static struct ctl_table vs_vars[] = { | |||
1491 | .proc_handler = &proc_dointvec_jiffies, | 1483 | .proc_handler = &proc_dointvec_jiffies, |
1492 | }, | 1484 | }, |
1493 | { | 1485 | { |
1494 | .ctl_name = NET_IPV4_VS_TO_SR, | ||
1495 | .procname = "timeout_synrecv", | 1486 | .procname = "timeout_synrecv", |
1496 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_SYN_RECV], | 1487 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_SYN_RECV], |
1497 | .maxlen = sizeof(int), | 1488 | .maxlen = sizeof(int), |
@@ -1499,7 +1490,6 @@ static struct ctl_table vs_vars[] = { | |||
1499 | .proc_handler = &proc_dointvec_jiffies, | 1490 | .proc_handler = &proc_dointvec_jiffies, |
1500 | }, | 1491 | }, |
1501 | { | 1492 | { |
1502 | .ctl_name = NET_IPV4_VS_TO_FW, | ||
1503 | .procname = "timeout_finwait", | 1493 | .procname = "timeout_finwait", |
1504 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_FIN_WAIT], | 1494 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_FIN_WAIT], |
1505 | .maxlen = sizeof(int), | 1495 | .maxlen = sizeof(int), |
@@ -1507,7 +1497,6 @@ static struct ctl_table vs_vars[] = { | |||
1507 | .proc_handler = &proc_dointvec_jiffies, | 1497 | .proc_handler = &proc_dointvec_jiffies, |
1508 | }, | 1498 | }, |
1509 | { | 1499 | { |
1510 | .ctl_name = NET_IPV4_VS_TO_TW, | ||
1511 | .procname = "timeout_timewait", | 1500 | .procname = "timeout_timewait", |
1512 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_TIME_WAIT], | 1501 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_TIME_WAIT], |
1513 | .maxlen = sizeof(int), | 1502 | .maxlen = sizeof(int), |
@@ -1515,7 +1504,6 @@ static struct ctl_table vs_vars[] = { | |||
1515 | .proc_handler = &proc_dointvec_jiffies, | 1504 | .proc_handler = &proc_dointvec_jiffies, |
1516 | }, | 1505 | }, |
1517 | { | 1506 | { |
1518 | .ctl_name = NET_IPV4_VS_TO_CL, | ||
1519 | .procname = "timeout_close", | 1507 | .procname = "timeout_close", |
1520 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_CLOSE], | 1508 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_CLOSE], |
1521 | .maxlen = sizeof(int), | 1509 | .maxlen = sizeof(int), |
@@ -1523,7 +1511,6 @@ static struct ctl_table vs_vars[] = { | |||
1523 | .proc_handler = &proc_dointvec_jiffies, | 1511 | .proc_handler = &proc_dointvec_jiffies, |
1524 | }, | 1512 | }, |
1525 | { | 1513 | { |
1526 | .ctl_name = NET_IPV4_VS_TO_CW, | ||
1527 | .procname = "timeout_closewait", | 1514 | .procname = "timeout_closewait", |
1528 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_CLOSE_WAIT], | 1515 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_CLOSE_WAIT], |
1529 | .maxlen = sizeof(int), | 1516 | .maxlen = sizeof(int), |
@@ -1531,7 +1518,6 @@ static struct ctl_table vs_vars[] = { | |||
1531 | .proc_handler = &proc_dointvec_jiffies, | 1518 | .proc_handler = &proc_dointvec_jiffies, |
1532 | }, | 1519 | }, |
1533 | { | 1520 | { |
1534 | .ctl_name = NET_IPV4_VS_TO_LA, | ||
1535 | .procname = "timeout_lastack", | 1521 | .procname = "timeout_lastack", |
1536 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_LAST_ACK], | 1522 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_LAST_ACK], |
1537 | .maxlen = sizeof(int), | 1523 | .maxlen = sizeof(int), |
@@ -1539,7 +1525,6 @@ static struct ctl_table vs_vars[] = { | |||
1539 | .proc_handler = &proc_dointvec_jiffies, | 1525 | .proc_handler = &proc_dointvec_jiffies, |
1540 | }, | 1526 | }, |
1541 | { | 1527 | { |
1542 | .ctl_name = NET_IPV4_VS_TO_LI, | ||
1543 | .procname = "timeout_listen", | 1528 | .procname = "timeout_listen", |
1544 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_LISTEN], | 1529 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_LISTEN], |
1545 | .maxlen = sizeof(int), | 1530 | .maxlen = sizeof(int), |
@@ -1547,7 +1532,6 @@ static struct ctl_table vs_vars[] = { | |||
1547 | .proc_handler = &proc_dointvec_jiffies, | 1532 | .proc_handler = &proc_dointvec_jiffies, |
1548 | }, | 1533 | }, |
1549 | { | 1534 | { |
1550 | .ctl_name = NET_IPV4_VS_TO_SA, | ||
1551 | .procname = "timeout_synack", | 1535 | .procname = "timeout_synack", |
1552 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_SYNACK], | 1536 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_SYNACK], |
1553 | .maxlen = sizeof(int), | 1537 | .maxlen = sizeof(int), |
@@ -1555,7 +1539,6 @@ static struct ctl_table vs_vars[] = { | |||
1555 | .proc_handler = &proc_dointvec_jiffies, | 1539 | .proc_handler = &proc_dointvec_jiffies, |
1556 | }, | 1540 | }, |
1557 | { | 1541 | { |
1558 | .ctl_name = NET_IPV4_VS_TO_UDP, | ||
1559 | .procname = "timeout_udp", | 1542 | .procname = "timeout_udp", |
1560 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_UDP], | 1543 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_UDP], |
1561 | .maxlen = sizeof(int), | 1544 | .maxlen = sizeof(int), |
@@ -1563,7 +1546,6 @@ static struct ctl_table vs_vars[] = { | |||
1563 | .proc_handler = &proc_dointvec_jiffies, | 1546 | .proc_handler = &proc_dointvec_jiffies, |
1564 | }, | 1547 | }, |
1565 | { | 1548 | { |
1566 | .ctl_name = NET_IPV4_VS_TO_ICMP, | ||
1567 | .procname = "timeout_icmp", | 1549 | .procname = "timeout_icmp", |
1568 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_ICMP], | 1550 | .data = &vs_timeout_table_dos.timeout[IP_VS_S_ICMP], |
1569 | .maxlen = sizeof(int), | 1551 | .maxlen = sizeof(int), |
@@ -1572,7 +1554,6 @@ static struct ctl_table vs_vars[] = { | |||
1572 | }, | 1554 | }, |
1573 | #endif | 1555 | #endif |
1574 | { | 1556 | { |
1575 | .ctl_name = NET_IPV4_VS_CACHE_BYPASS, | ||
1576 | .procname = "cache_bypass", | 1557 | .procname = "cache_bypass", |
1577 | .data = &sysctl_ip_vs_cache_bypass, | 1558 | .data = &sysctl_ip_vs_cache_bypass, |
1578 | .maxlen = sizeof(int), | 1559 | .maxlen = sizeof(int), |
@@ -1580,7 +1561,6 @@ static struct ctl_table vs_vars[] = { | |||
1580 | .proc_handler = &proc_dointvec, | 1561 | .proc_handler = &proc_dointvec, |
1581 | }, | 1562 | }, |
1582 | { | 1563 | { |
1583 | .ctl_name = NET_IPV4_VS_EXPIRE_NODEST_CONN, | ||
1584 | .procname = "expire_nodest_conn", | 1564 | .procname = "expire_nodest_conn", |
1585 | .data = &sysctl_ip_vs_expire_nodest_conn, | 1565 | .data = &sysctl_ip_vs_expire_nodest_conn, |
1586 | .maxlen = sizeof(int), | 1566 | .maxlen = sizeof(int), |
@@ -1588,7 +1568,6 @@ static struct ctl_table vs_vars[] = { | |||
1588 | .proc_handler = &proc_dointvec, | 1568 | .proc_handler = &proc_dointvec, |
1589 | }, | 1569 | }, |
1590 | { | 1570 | { |
1591 | .ctl_name = NET_IPV4_VS_EXPIRE_QUIESCENT_TEMPLATE, | ||
1592 | .procname = "expire_quiescent_template", | 1571 | .procname = "expire_quiescent_template", |
1593 | .data = &sysctl_ip_vs_expire_quiescent_template, | 1572 | .data = &sysctl_ip_vs_expire_quiescent_template, |
1594 | .maxlen = sizeof(int), | 1573 | .maxlen = sizeof(int), |
@@ -1596,7 +1575,6 @@ static struct ctl_table vs_vars[] = { | |||
1596 | .proc_handler = &proc_dointvec, | 1575 | .proc_handler = &proc_dointvec, |
1597 | }, | 1576 | }, |
1598 | { | 1577 | { |
1599 | .ctl_name = NET_IPV4_VS_SYNC_THRESHOLD, | ||
1600 | .procname = "sync_threshold", | 1578 | .procname = "sync_threshold", |
1601 | .data = &sysctl_ip_vs_sync_threshold, | 1579 | .data = &sysctl_ip_vs_sync_threshold, |
1602 | .maxlen = sizeof(sysctl_ip_vs_sync_threshold), | 1580 | .maxlen = sizeof(sysctl_ip_vs_sync_threshold), |
@@ -1604,7 +1582,6 @@ static struct ctl_table vs_vars[] = { | |||
1604 | .proc_handler = &proc_do_sync_threshold, | 1582 | .proc_handler = &proc_do_sync_threshold, |
1605 | }, | 1583 | }, |
1606 | { | 1584 | { |
1607 | .ctl_name = NET_IPV4_VS_NAT_ICMP_SEND, | ||
1608 | .procname = "nat_icmp_send", | 1585 | .procname = "nat_icmp_send", |
1609 | .data = &sysctl_ip_vs_nat_icmp_send, | 1586 | .data = &sysctl_ip_vs_nat_icmp_send, |
1610 | .maxlen = sizeof(int), | 1587 | .maxlen = sizeof(int), |
@@ -1616,7 +1593,6 @@ static struct ctl_table vs_vars[] = { | |||
1616 | 1593 | ||
1617 | static ctl_table vs_table[] = { | 1594 | static ctl_table vs_table[] = { |
1618 | { | 1595 | { |
1619 | .ctl_name = NET_IPV4_VS, | ||
1620 | .procname = "vs", | 1596 | .procname = "vs", |
1621 | .mode = 0555, | 1597 | .mode = 0555, |
1622 | .child = vs_vars | 1598 | .child = vs_vars |
diff --git a/net/ipv4/ipvs/ip_vs_lblc.c b/net/ipv4/ipvs/ip_vs_lblc.c index 052f4ed59174..b843a11d7cf7 100644 --- a/net/ipv4/ipvs/ip_vs_lblc.c +++ b/net/ipv4/ipvs/ip_vs_lblc.c | |||
@@ -114,7 +114,6 @@ struct ip_vs_lblc_table { | |||
114 | 114 | ||
115 | static ctl_table vs_vars_table[] = { | 115 | static ctl_table vs_vars_table[] = { |
116 | { | 116 | { |
117 | .ctl_name = NET_IPV4_VS_LBLC_EXPIRE, | ||
118 | .procname = "lblc_expiration", | 117 | .procname = "lblc_expiration", |
119 | .data = &sysctl_ip_vs_lblc_expiration, | 118 | .data = &sysctl_ip_vs_lblc_expiration, |
120 | .maxlen = sizeof(int), | 119 | .maxlen = sizeof(int), |
@@ -126,7 +125,6 @@ static ctl_table vs_vars_table[] = { | |||
126 | 125 | ||
127 | static ctl_table vs_table[] = { | 126 | static ctl_table vs_table[] = { |
128 | { | 127 | { |
129 | .ctl_name = NET_IPV4_VS, | ||
130 | .procname = "vs", | 128 | .procname = "vs", |
131 | .mode = 0555, | 129 | .mode = 0555, |
132 | .child = vs_vars_table | 130 | .child = vs_vars_table |
diff --git a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c index 427b593c1069..e5b323a6b2f7 100644 --- a/net/ipv4/ipvs/ip_vs_lblcr.c +++ b/net/ipv4/ipvs/ip_vs_lblcr.c | |||
@@ -302,7 +302,6 @@ struct ip_vs_lblcr_table { | |||
302 | 302 | ||
303 | static ctl_table vs_vars_table[] = { | 303 | static ctl_table vs_vars_table[] = { |
304 | { | 304 | { |
305 | .ctl_name = NET_IPV4_VS_LBLCR_EXPIRE, | ||
306 | .procname = "lblcr_expiration", | 305 | .procname = "lblcr_expiration", |
307 | .data = &sysctl_ip_vs_lblcr_expiration, | 306 | .data = &sysctl_ip_vs_lblcr_expiration, |
308 | .maxlen = sizeof(int), | 307 | .maxlen = sizeof(int), |
@@ -314,7 +313,6 @@ static ctl_table vs_vars_table[] = { | |||
314 | 313 | ||
315 | static ctl_table vs_table[] = { | 314 | static ctl_table vs_table[] = { |
316 | { | 315 | { |
317 | .ctl_name = NET_IPV4_VS, | ||
318 | .procname = "vs", | 316 | .procname = "vs", |
319 | .mode = 0555, | 317 | .mode = 0555, |
320 | .child = vs_vars_table | 318 | .child = vs_vars_table |
diff --git a/net/ipv4/ipvs/ip_vs_proto.c b/net/ipv4/ipvs/ip_vs_proto.c index e844ddb82b9a..c0e11ec8f0f9 100644 --- a/net/ipv4/ipvs/ip_vs_proto.c +++ b/net/ipv4/ipvs/ip_vs_proto.c | |||
@@ -45,7 +45,7 @@ static struct ip_vs_protocol *ip_vs_proto_table[IP_VS_PROTO_TAB_SIZE]; | |||
45 | /* | 45 | /* |
46 | * register an ipvs protocol | 46 | * register an ipvs protocol |
47 | */ | 47 | */ |
48 | static int register_ip_vs_protocol(struct ip_vs_protocol *pp) | 48 | static int __used register_ip_vs_protocol(struct ip_vs_protocol *pp) |
49 | { | 49 | { |
50 | unsigned hash = IP_VS_PROTO_HASH(pp->protocol); | 50 | unsigned hash = IP_VS_PROTO_HASH(pp->protocol); |
51 | 51 | ||
diff --git a/net/ipv4/netfilter/iptable_raw.c b/net/ipv4/netfilter/iptable_raw.c index 5de6e57ac55c..f8678651250f 100644 --- a/net/ipv4/netfilter/iptable_raw.c +++ b/net/ipv4/netfilter/iptable_raw.c | |||
@@ -66,7 +66,7 @@ ipt_local_hook(unsigned int hook, | |||
66 | if (skb->len < sizeof(struct iphdr) || | 66 | if (skb->len < sizeof(struct iphdr) || |
67 | ip_hdrlen(skb) < sizeof(struct iphdr)) { | 67 | ip_hdrlen(skb) < sizeof(struct iphdr)) { |
68 | if (net_ratelimit()) | 68 | if (net_ratelimit()) |
69 | printk("iptable_raw: ignoring short SOCK_RAW" | 69 | printk("iptable_raw: ignoring short SOCK_RAW " |
70 | "packet.\n"); | 70 | "packet.\n"); |
71 | return NF_ACCEPT; | 71 | return NF_ACCEPT; |
72 | } | 72 | } |
diff --git a/net/ipv4/netfilter/nf_nat_core.c b/net/ipv4/netfilter/nf_nat_core.c index 70e7997ea284..86b465b176ba 100644 --- a/net/ipv4/netfilter/nf_nat_core.c +++ b/net/ipv4/netfilter/nf_nat_core.c | |||
@@ -607,13 +607,10 @@ static void nf_nat_move_storage(struct nf_conn *conntrack, void *old) | |||
607 | struct nf_conn_nat *new_nat = nf_ct_ext_find(conntrack, NF_CT_EXT_NAT); | 607 | struct nf_conn_nat *new_nat = nf_ct_ext_find(conntrack, NF_CT_EXT_NAT); |
608 | struct nf_conn_nat *old_nat = (struct nf_conn_nat *)old; | 608 | struct nf_conn_nat *old_nat = (struct nf_conn_nat *)old; |
609 | struct nf_conn *ct = old_nat->ct; | 609 | struct nf_conn *ct = old_nat->ct; |
610 | unsigned int srchash; | ||
611 | 610 | ||
612 | if (!(ct->status & IPS_NAT_DONE_MASK)) | 611 | if (!ct || !(ct->status & IPS_NAT_DONE_MASK)) |
613 | return; | 612 | return; |
614 | 613 | ||
615 | srchash = hash_by_src(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple); | ||
616 | |||
617 | write_lock_bh(&nf_nat_lock); | 614 | write_lock_bh(&nf_nat_lock); |
618 | hlist_replace_rcu(&old_nat->bysource, &new_nat->bysource); | 615 | hlist_replace_rcu(&old_nat->bysource, &new_nat->bysource); |
619 | new_nat->ct = ct; | 616 | new_nat->ct = ct; |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 1bff9ed349ff..c426dec6d579 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -2888,18 +2888,14 @@ static int ip_rt_acct_read(char *buffer, char **start, off_t offset, | |||
2888 | offset /= sizeof(u32); | 2888 | offset /= sizeof(u32); |
2889 | 2889 | ||
2890 | if (length > 0) { | 2890 | if (length > 0) { |
2891 | u32 *src = ((u32 *) IP_RT_ACCT_CPU(0)) + offset; | ||
2892 | u32 *dst = (u32 *) buffer; | 2891 | u32 *dst = (u32 *) buffer; |
2893 | 2892 | ||
2894 | /* Copy first cpu. */ | ||
2895 | *start = buffer; | 2893 | *start = buffer; |
2896 | memcpy(dst, src, length); | 2894 | memset(dst, 0, length); |
2897 | 2895 | ||
2898 | /* Add the other cpus in, one int at a time */ | ||
2899 | for_each_possible_cpu(i) { | 2896 | for_each_possible_cpu(i) { |
2900 | unsigned int j; | 2897 | unsigned int j; |
2901 | 2898 | u32 *src = ((u32 *) IP_RT_ACCT_CPU(i)) + offset; | |
2902 | src = ((u32 *) IP_RT_ACCT_CPU(i)) + offset; | ||
2903 | 2899 | ||
2904 | for (j = 0; j < length/4; j++) | 2900 | for (j = 0; j < length/4; j++) |
2905 | dst[j] += src[j]; | 2901 | dst[j] += src[j]; |
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index ffddd2b45352..bec6fe880657 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c | |||
@@ -191,7 +191,7 @@ static int sysctl_tcp_congestion_control(ctl_table *table, int __user *name, | |||
191 | 191 | ||
192 | tcp_get_default_congestion_control(val); | 192 | tcp_get_default_congestion_control(val); |
193 | ret = sysctl_string(&tbl, name, nlen, oldval, oldlenp, newval, newlen); | 193 | ret = sysctl_string(&tbl, name, nlen, oldval, oldlenp, newval, newlen); |
194 | if (ret == 0 && newval && newlen) | 194 | if (ret == 1 && newval && newlen) |
195 | ret = tcp_set_default_congestion_control(val); | 195 | ret = tcp_set_default_congestion_control(val); |
196 | return ret; | 196 | return ret; |
197 | } | 197 | } |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index e566f3c67677..652c32368ccc 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -900,8 +900,7 @@ int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, | |||
900 | sizeof(*keys) * md5sig->entries4); | 900 | sizeof(*keys) * md5sig->entries4); |
901 | 901 | ||
902 | /* Free old key list, and reference new one */ | 902 | /* Free old key list, and reference new one */ |
903 | if (md5sig->keys4) | 903 | kfree(md5sig->keys4); |
904 | kfree(md5sig->keys4); | ||
905 | md5sig->keys4 = keys; | 904 | md5sig->keys4 = keys; |
906 | md5sig->alloced4++; | 905 | md5sig->alloced4++; |
907 | } | 906 | } |
@@ -939,10 +938,10 @@ int tcp_v4_md5_do_del(struct sock *sk, __be32 addr) | |||
939 | tp->md5sig_info->alloced4 = 0; | 938 | tp->md5sig_info->alloced4 = 0; |
940 | } else if (tp->md5sig_info->entries4 != i) { | 939 | } else if (tp->md5sig_info->entries4 != i) { |
941 | /* Need to do some manipulation */ | 940 | /* Need to do some manipulation */ |
942 | memcpy(&tp->md5sig_info->keys4[i], | 941 | memmove(&tp->md5sig_info->keys4[i], |
943 | &tp->md5sig_info->keys4[i+1], | 942 | &tp->md5sig_info->keys4[i+1], |
944 | (tp->md5sig_info->entries4 - i) * | 943 | (tp->md5sig_info->entries4 - i) * |
945 | sizeof(struct tcp4_md5sig_key)); | 944 | sizeof(struct tcp4_md5sig_key)); |
946 | } | 945 | } |
947 | tcp_free_md5sig_pool(); | 946 | tcp_free_md5sig_pool(); |
948 | return 0; | 947 | return 0; |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 324b4207254a..e5130a7fe181 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -1295,6 +1295,7 @@ static int tcp_mtu_probe(struct sock *sk) | |||
1295 | struct sk_buff *skb, *nskb, *next; | 1295 | struct sk_buff *skb, *nskb, *next; |
1296 | int len; | 1296 | int len; |
1297 | int probe_size; | 1297 | int probe_size; |
1298 | int size_needed; | ||
1298 | unsigned int pif; | 1299 | unsigned int pif; |
1299 | int copy; | 1300 | int copy; |
1300 | int mss_now; | 1301 | int mss_now; |
@@ -1313,27 +1314,20 @@ static int tcp_mtu_probe(struct sock *sk) | |||
1313 | /* Very simple search strategy: just double the MSS. */ | 1314 | /* Very simple search strategy: just double the MSS. */ |
1314 | mss_now = tcp_current_mss(sk, 0); | 1315 | mss_now = tcp_current_mss(sk, 0); |
1315 | probe_size = 2*tp->mss_cache; | 1316 | probe_size = 2*tp->mss_cache; |
1317 | size_needed = probe_size + (tp->reordering + 1) * tp->mss_cache; | ||
1316 | if (probe_size > tcp_mtu_to_mss(sk, icsk->icsk_mtup.search_high)) { | 1318 | if (probe_size > tcp_mtu_to_mss(sk, icsk->icsk_mtup.search_high)) { |
1317 | /* TODO: set timer for probe_converge_event */ | 1319 | /* TODO: set timer for probe_converge_event */ |
1318 | return -1; | 1320 | return -1; |
1319 | } | 1321 | } |
1320 | 1322 | ||
1321 | /* Have enough data in the send queue to probe? */ | 1323 | /* Have enough data in the send queue to probe? */ |
1322 | len = 0; | 1324 | if (tp->write_seq - tp->snd_nxt < size_needed) |
1323 | if ((skb = tcp_send_head(sk)) == NULL) | ||
1324 | return -1; | ||
1325 | while ((len += skb->len) < probe_size && !tcp_skb_is_last(sk, skb)) | ||
1326 | skb = tcp_write_queue_next(sk, skb); | ||
1327 | if (len < probe_size) | ||
1328 | return -1; | 1325 | return -1; |
1329 | 1326 | ||
1330 | /* Receive window check. */ | 1327 | if (tp->snd_wnd < size_needed) |
1331 | if (after(TCP_SKB_CB(skb)->seq + probe_size, tp->snd_una + tp->snd_wnd)) { | 1328 | return -1; |
1332 | if (tp->snd_wnd < probe_size) | 1329 | if (after(tp->snd_nxt + size_needed, tp->snd_una + tp->snd_wnd)) |
1333 | return -1; | 1330 | return 0; |
1334 | else | ||
1335 | return 0; | ||
1336 | } | ||
1337 | 1331 | ||
1338 | /* Do we need to wait to drain cwnd? */ | 1332 | /* Do we need to wait to drain cwnd? */ |
1339 | pif = tcp_packets_in_flight(tp); | 1333 | pif = tcp_packets_in_flight(tp); |
@@ -1352,7 +1346,6 @@ static int tcp_mtu_probe(struct sock *sk) | |||
1352 | 1346 | ||
1353 | skb = tcp_send_head(sk); | 1347 | skb = tcp_send_head(sk); |
1354 | tcp_insert_write_queue_before(nskb, skb, sk); | 1348 | tcp_insert_write_queue_before(nskb, skb, sk); |
1355 | tcp_advance_send_head(sk, skb); | ||
1356 | 1349 | ||
1357 | TCP_SKB_CB(nskb)->seq = TCP_SKB_CB(skb)->seq; | 1350 | TCP_SKB_CB(nskb)->seq = TCP_SKB_CB(skb)->seq; |
1358 | TCP_SKB_CB(nskb)->end_seq = TCP_SKB_CB(skb)->seq + probe_size; | 1351 | TCP_SKB_CB(nskb)->end_seq = TCP_SKB_CB(skb)->seq + probe_size; |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 1bd8d818f8e9..567664eac463 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -967,7 +967,7 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev, | |||
967 | if (unlikely(score.addr_type == IPV6_ADDR_ANY || | 967 | if (unlikely(score.addr_type == IPV6_ADDR_ANY || |
968 | score.addr_type & IPV6_ADDR_MULTICAST)) { | 968 | score.addr_type & IPV6_ADDR_MULTICAST)) { |
969 | LIMIT_NETDEBUG(KERN_DEBUG | 969 | LIMIT_NETDEBUG(KERN_DEBUG |
970 | "ADDRCONF: unspecified / multicast address" | 970 | "ADDRCONF: unspecified / multicast address " |
971 | "assigned as unicast address on %s", | 971 | "assigned as unicast address on %s", |
972 | dev->name); | 972 | dev->name); |
973 | continue; | 973 | continue; |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 3aad861975a0..93980c3b83e6 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -581,7 +581,10 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer, | |||
581 | } | 581 | } |
582 | sk->sk_route_caps &= ~NETIF_F_GSO_MASK; | 582 | sk->sk_route_caps &= ~NETIF_F_GSO_MASK; |
583 | } | 583 | } |
584 | tcp_alloc_md5sig_pool(); | 584 | if (tcp_alloc_md5sig_pool() == NULL) { |
585 | kfree(newkey); | ||
586 | return -ENOMEM; | ||
587 | } | ||
585 | if (tp->md5sig_info->alloced6 == tp->md5sig_info->entries6) { | 588 | if (tp->md5sig_info->alloced6 == tp->md5sig_info->entries6) { |
586 | keys = kmalloc((sizeof (tp->md5sig_info->keys6[0]) * | 589 | keys = kmalloc((sizeof (tp->md5sig_info->keys6[0]) * |
587 | (tp->md5sig_info->entries6 + 1)), GFP_ATOMIC); | 590 | (tp->md5sig_info->entries6 + 1)), GFP_ATOMIC); |
@@ -634,10 +637,6 @@ static int tcp_v6_md5_do_del(struct sock *sk, struct in6_addr *peer) | |||
634 | kfree(tp->md5sig_info->keys6); | 637 | kfree(tp->md5sig_info->keys6); |
635 | tp->md5sig_info->keys6 = NULL; | 638 | tp->md5sig_info->keys6 = NULL; |
636 | tp->md5sig_info->alloced6 = 0; | 639 | tp->md5sig_info->alloced6 = 0; |
637 | |||
638 | tcp_free_md5sig_pool(); | ||
639 | |||
640 | return 0; | ||
641 | } else { | 640 | } else { |
642 | /* shrink the database */ | 641 | /* shrink the database */ |
643 | if (tp->md5sig_info->entries6 != i) | 642 | if (tp->md5sig_info->entries6 != i) |
@@ -646,6 +645,8 @@ static int tcp_v6_md5_do_del(struct sock *sk, struct in6_addr *peer) | |||
646 | (tp->md5sig_info->entries6 - i) | 645 | (tp->md5sig_info->entries6 - i) |
647 | * sizeof (tp->md5sig_info->keys6[0])); | 646 | * sizeof (tp->md5sig_info->keys6[0])); |
648 | } | 647 | } |
648 | tcp_free_md5sig_pool(); | ||
649 | return 0; | ||
649 | } | 650 | } |
650 | } | 651 | } |
651 | return -ENOENT; | 652 | return -ENOENT; |
diff --git a/net/irda/iriap.c b/net/irda/iriap.c index dc5e34a01620..a86a5d83786b 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c | |||
@@ -928,7 +928,7 @@ void iriap_call_indication(struct iriap_cb *self, struct sk_buff *skb) | |||
928 | 928 | ||
929 | opcode = fp[0]; | 929 | opcode = fp[0]; |
930 | if (~opcode & 0x80) { | 930 | if (~opcode & 0x80) { |
931 | IRDA_WARNING("%s: IrIAS multiframe commands or results" | 931 | IRDA_WARNING("%s: IrIAS multiframe commands or results " |
932 | "is not implemented yet!\n", __FUNCTION__); | 932 | "is not implemented yet!\n", __FUNCTION__); |
933 | return; | 933 | return; |
934 | } | 934 | } |
diff --git a/net/irda/irlan/irlan_eth.c b/net/irda/irlan/irlan_eth.c index 7f9c8542e5fc..c68220773d28 100644 --- a/net/irda/irlan/irlan_eth.c +++ b/net/irda/irlan/irlan_eth.c | |||
@@ -296,6 +296,7 @@ void irlan_eth_flow_indication(void *instance, void *sap, LOCAL_FLOW flow) | |||
296 | */ | 296 | */ |
297 | void irlan_eth_send_gratuitous_arp(struct net_device *dev) | 297 | void irlan_eth_send_gratuitous_arp(struct net_device *dev) |
298 | { | 298 | { |
299 | #ifdef CONFIG_INET | ||
299 | struct in_device *in_dev; | 300 | struct in_device *in_dev; |
300 | 301 | ||
301 | /* | 302 | /* |
@@ -303,7 +304,6 @@ void irlan_eth_send_gratuitous_arp(struct net_device *dev) | |||
303 | * is useful if we have changed access points on the same | 304 | * is useful if we have changed access points on the same |
304 | * subnet. | 305 | * subnet. |
305 | */ | 306 | */ |
306 | #ifdef CONFIG_INET | ||
307 | IRDA_DEBUG(4, "IrLAN: Sending gratuitous ARP\n"); | 307 | IRDA_DEBUG(4, "IrLAN: Sending gratuitous ARP\n"); |
308 | rcu_read_lock(); | 308 | rcu_read_lock(); |
309 | in_dev = __in_dev_get_rcu(dev); | 309 | in_dev = __in_dev_get_rcu(dev); |
diff --git a/net/key/af_key.c b/net/key/af_key.c index 10c89d47f685..878039b9557d 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -1015,9 +1015,7 @@ static inline struct sk_buff *pfkey_xfrm_state2msg(struct xfrm_state *x) | |||
1015 | { | 1015 | { |
1016 | struct sk_buff *skb; | 1016 | struct sk_buff *skb; |
1017 | 1017 | ||
1018 | spin_lock_bh(&x->lock); | ||
1019 | skb = __pfkey_xfrm_state2msg(x, 1, 3); | 1018 | skb = __pfkey_xfrm_state2msg(x, 1, 3); |
1020 | spin_unlock_bh(&x->lock); | ||
1021 | 1019 | ||
1022 | return skb; | 1020 | return skb; |
1023 | } | 1021 | } |
@@ -1552,7 +1550,7 @@ static int pfkey_get(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, | |||
1552 | 1550 | ||
1553 | out_hdr = (struct sadb_msg *) out_skb->data; | 1551 | out_hdr = (struct sadb_msg *) out_skb->data; |
1554 | out_hdr->sadb_msg_version = hdr->sadb_msg_version; | 1552 | out_hdr->sadb_msg_version = hdr->sadb_msg_version; |
1555 | out_hdr->sadb_msg_type = SADB_DUMP; | 1553 | out_hdr->sadb_msg_type = SADB_GET; |
1556 | out_hdr->sadb_msg_satype = pfkey_proto2satype(proto); | 1554 | out_hdr->sadb_msg_satype = pfkey_proto2satype(proto); |
1557 | out_hdr->sadb_msg_errno = 0; | 1555 | out_hdr->sadb_msg_errno = 0; |
1558 | out_hdr->sadb_msg_reserved = 0; | 1556 | out_hdr->sadb_msg_reserved = 0; |
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c index e0ee65a969bc..59350b8727ec 100644 --- a/net/mac80211/ieee80211.c +++ b/net/mac80211/ieee80211.c | |||
@@ -267,6 +267,17 @@ static int ieee80211_open(struct net_device *dev) | |||
267 | tasklet_enable(&local->tasklet); | 267 | tasklet_enable(&local->tasklet); |
268 | } | 268 | } |
269 | 269 | ||
270 | /* | ||
271 | * set_multicast_list will be invoked by the networking core | ||
272 | * which will check whether any increments here were done in | ||
273 | * error and sync them down to the hardware as filter flags. | ||
274 | */ | ||
275 | if (sdata->flags & IEEE80211_SDATA_ALLMULTI) | ||
276 | atomic_inc(&local->iff_allmultis); | ||
277 | |||
278 | if (sdata->flags & IEEE80211_SDATA_PROMISC) | ||
279 | atomic_inc(&local->iff_promiscs); | ||
280 | |||
270 | local->open_count++; | 281 | local->open_count++; |
271 | 282 | ||
272 | netif_start_queue(dev); | 283 | netif_start_queue(dev); |
@@ -284,6 +295,18 @@ static int ieee80211_stop(struct net_device *dev) | |||
284 | 295 | ||
285 | netif_stop_queue(dev); | 296 | netif_stop_queue(dev); |
286 | 297 | ||
298 | /* | ||
299 | * Don't count this interface for promisc/allmulti while it | ||
300 | * is down. dev_mc_unsync() will invoke set_multicast_list | ||
301 | * on the master interface which will sync these down to the | ||
302 | * hardware as filter flags. | ||
303 | */ | ||
304 | if (sdata->flags & IEEE80211_SDATA_ALLMULTI) | ||
305 | atomic_dec(&local->iff_allmultis); | ||
306 | |||
307 | if (sdata->flags & IEEE80211_SDATA_PROMISC) | ||
308 | atomic_dec(&local->iff_promiscs); | ||
309 | |||
287 | dev_mc_unsync(local->mdev, dev); | 310 | dev_mc_unsync(local->mdev, dev); |
288 | 311 | ||
289 | /* down all dependent devices, that is VLANs */ | 312 | /* down all dependent devices, that is VLANs */ |
@@ -366,8 +389,8 @@ static void ieee80211_set_multicast_list(struct net_device *dev) | |||
366 | 389 | ||
367 | allmulti = !!(dev->flags & IFF_ALLMULTI); | 390 | allmulti = !!(dev->flags & IFF_ALLMULTI); |
368 | promisc = !!(dev->flags & IFF_PROMISC); | 391 | promisc = !!(dev->flags & IFF_PROMISC); |
369 | sdata_allmulti = sdata->flags & IEEE80211_SDATA_ALLMULTI; | 392 | sdata_allmulti = !!(sdata->flags & IEEE80211_SDATA_ALLMULTI); |
370 | sdata_promisc = sdata->flags & IEEE80211_SDATA_PROMISC; | 393 | sdata_promisc = !!(sdata->flags & IEEE80211_SDATA_PROMISC); |
371 | 394 | ||
372 | if (allmulti != sdata_allmulti) { | 395 | if (allmulti != sdata_allmulti) { |
373 | if (dev->flags & IFF_ALLMULTI) | 396 | if (dev->flags & IFF_ALLMULTI) |
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index 015b3f879aa9..16afd24d4f6b 100644 --- a/net/mac80211/ieee80211_sta.c +++ b/net/mac80211/ieee80211_sta.c | |||
@@ -2647,7 +2647,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw) | |||
2647 | local->sta_scanning = 0; | 2647 | local->sta_scanning = 0; |
2648 | 2648 | ||
2649 | if (ieee80211_hw_config(local)) | 2649 | if (ieee80211_hw_config(local)) |
2650 | printk(KERN_DEBUG "%s: failed to restore operational" | 2650 | printk(KERN_DEBUG "%s: failed to restore operational " |
2651 | "channel after scan\n", dev->name); | 2651 | "channel after scan\n", dev->name); |
2652 | 2652 | ||
2653 | 2653 | ||
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 5ebbe808d801..b8bbb960723c 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -1146,7 +1146,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep, | |||
1146 | /* Check if the timestamp looks valid. */ | 1146 | /* Check if the timestamp looks valid. */ |
1147 | if (time_after(hbinfo->sent_at, jiffies) || | 1147 | if (time_after(hbinfo->sent_at, jiffies) || |
1148 | time_after(jiffies, hbinfo->sent_at + max_interval)) { | 1148 | time_after(jiffies, hbinfo->sent_at + max_interval)) { |
1149 | SCTP_DEBUG_PRINTK("%s: HEARTBEAT ACK with invalid timestamp" | 1149 | SCTP_DEBUG_PRINTK("%s: HEARTBEAT ACK with invalid timestamp " |
1150 | "received for transport: %p\n", | 1150 | "received for transport: %p\n", |
1151 | __FUNCTION__, link); | 1151 | __FUNCTION__, link); |
1152 | return SCTP_DISPOSITION_DISCARD; | 1152 | return SCTP_DISPOSITION_DISCARD; |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 282a9a2ec90c..cd641c8634f0 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -62,7 +62,7 @@ static inline void do_xprt_reserve(struct rpc_task *); | |||
62 | static void xprt_connect_status(struct rpc_task *task); | 62 | static void xprt_connect_status(struct rpc_task *task); |
63 | static int __xprt_get_cong(struct rpc_xprt *, struct rpc_task *); | 63 | static int __xprt_get_cong(struct rpc_xprt *, struct rpc_task *); |
64 | 64 | ||
65 | static spinlock_t xprt_list_lock = SPIN_LOCK_UNLOCKED; | 65 | static DEFINE_SPINLOCK(xprt_list_lock); |
66 | static LIST_HEAD(xprt_list); | 66 | static LIST_HEAD(xprt_list); |
67 | 67 | ||
68 | /* | 68 | /* |
diff --git a/net/wireless/wext.c b/net/wireless/wext.c index 85e5f9dd0d8e..47e80cc2077c 100644 --- a/net/wireless/wext.c +++ b/net/wireless/wext.c | |||
@@ -1094,7 +1094,7 @@ int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, | |||
1094 | rtnl_lock(); | 1094 | rtnl_lock(); |
1095 | ret = wireless_process_ioctl(net, ifr, cmd); | 1095 | ret = wireless_process_ioctl(net, ifr, cmd); |
1096 | rtnl_unlock(); | 1096 | rtnl_unlock(); |
1097 | if (IW_IS_GET(cmd) && copy_to_user(arg, ifr, sizeof(struct ifreq))) | 1097 | if (IW_IS_GET(cmd) && copy_to_user(arg, ifr, sizeof(struct iwreq))) |
1098 | return -EFAULT; | 1098 | return -EFAULT; |
1099 | return ret; | 1099 | return ret; |
1100 | } | 1100 | } |
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 224b44e31a07..cf43c49eab37 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -552,7 +552,7 @@ int __xfrm_state_delete(struct xfrm_state *x) | |||
552 | * The xfrm_state_alloc call gives a reference, and that | 552 | * The xfrm_state_alloc call gives a reference, and that |
553 | * is what we are dropping here. | 553 | * is what we are dropping here. |
554 | */ | 554 | */ |
555 | __xfrm_state_put(x); | 555 | xfrm_state_put(x); |
556 | err = 0; | 556 | err = 0; |
557 | } | 557 | } |
558 | 558 | ||
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index d41588d101d0..e75dbdcb08a4 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -507,7 +507,6 @@ static int copy_to_user_state_extra(struct xfrm_state *x, | |||
507 | struct xfrm_usersa_info *p, | 507 | struct xfrm_usersa_info *p, |
508 | struct sk_buff *skb) | 508 | struct sk_buff *skb) |
509 | { | 509 | { |
510 | spin_lock_bh(&x->lock); | ||
511 | copy_to_user_state(x, p); | 510 | copy_to_user_state(x, p); |
512 | 511 | ||
513 | if (x->coaddr) | 512 | if (x->coaddr) |
@@ -515,7 +514,6 @@ static int copy_to_user_state_extra(struct xfrm_state *x, | |||
515 | 514 | ||
516 | if (x->lastused) | 515 | if (x->lastused) |
517 | NLA_PUT_U64(skb, XFRMA_LASTUSED, x->lastused); | 516 | NLA_PUT_U64(skb, XFRMA_LASTUSED, x->lastused); |
518 | spin_unlock_bh(&x->lock); | ||
519 | 517 | ||
520 | if (x->aalg) | 518 | if (x->aalg) |
521 | NLA_PUT(skb, XFRMA_ALG_AUTH, alg_len(x->aalg), x->aalg); | 519 | NLA_PUT(skb, XFRMA_ALG_AUTH, alg_len(x->aalg), x->aalg); |