diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-08-29 16:40:27 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-29 16:40:27 -0400 |
commit | c1b054d03f5b31c33eaa0b267c629b118eaf3790 (patch) | |
tree | 9333907ca767be24fcb3667877242976c3e3c8dd /net/ipv4/tcp_ipv4.c | |
parent | 559fb51ba7e66fe298b8355fabde1275b7def35f (diff) | |
parent | bf4e70e54cf31dcca48d279c7f7e71328eebe749 (diff) |
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 2d41d5d6ad19..67c670886c1f 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -242,9 +242,14 @@ static int tcp_v4_get_port(struct sock *sk, unsigned short snum) | |||
242 | tcp_port_rover = rover; | 242 | tcp_port_rover = rover; |
243 | spin_unlock(&tcp_portalloc_lock); | 243 | spin_unlock(&tcp_portalloc_lock); |
244 | 244 | ||
245 | /* Exhausted local port range during search? */ | 245 | /* Exhausted local port range during search? It is not |
246 | * possible for us to be holding one of the bind hash | ||
247 | * locks if this test triggers, because if 'remaining' | ||
248 | * drops to zero, we broke out of the do/while loop at | ||
249 | * the top level, not from the 'break;' statement. | ||
250 | */ | ||
246 | ret = 1; | 251 | ret = 1; |
247 | if (remaining <= 0) | 252 | if (unlikely(remaining <= 0)) |
248 | goto fail; | 253 | goto fail; |
249 | 254 | ||
250 | /* OK, here is the one we will use. HEAD is | 255 | /* OK, here is the one we will use. HEAD is |
@@ -1494,12 +1499,11 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
1494 | * to destinations, already remembered | 1499 | * to destinations, already remembered |
1495 | * to the moment of synflood. | 1500 | * to the moment of synflood. |
1496 | */ | 1501 | */ |
1497 | NETDEBUG(if (net_ratelimit()) \ | 1502 | LIMIT_NETDEBUG(printk(KERN_DEBUG "TCP: drop open " |
1498 | printk(KERN_DEBUG "TCP: drop open " | 1503 | "request from %u.%u." |
1499 | "request from %u.%u." | 1504 | "%u.%u/%u\n", |
1500 | "%u.%u/%u\n", \ | 1505 | NIPQUAD(saddr), |
1501 | NIPQUAD(saddr), | 1506 | ntohs(skb->h.th->source))); |
1502 | ntohs(skb->h.th->source))); | ||
1503 | dst_release(dst); | 1507 | dst_release(dst); |
1504 | goto drop_and_free; | 1508 | goto drop_and_free; |
1505 | } | 1509 | } |
@@ -1627,8 +1631,7 @@ static int tcp_v4_checksum_init(struct sk_buff *skb) | |||
1627 | skb->nh.iph->daddr, skb->csum)) | 1631 | skb->nh.iph->daddr, skb->csum)) |
1628 | return 0; | 1632 | return 0; |
1629 | 1633 | ||
1630 | NETDEBUG(if (net_ratelimit()) | 1634 | LIMIT_NETDEBUG(printk(KERN_DEBUG "hw tcp v4 csum failed\n")); |
1631 | printk(KERN_DEBUG "hw tcp v4 csum failed\n")); | ||
1632 | skb->ip_summed = CHECKSUM_NONE; | 1635 | skb->ip_summed = CHECKSUM_NONE; |
1633 | } | 1636 | } |
1634 | if (skb->len <= 76) { | 1637 | if (skb->len <= 76) { |
@@ -2045,9 +2048,10 @@ static int tcp_v4_init_sock(struct sock *sk) | |||
2045 | */ | 2048 | */ |
2046 | tp->snd_ssthresh = 0x7fffffff; /* Infinity */ | 2049 | tp->snd_ssthresh = 0x7fffffff; /* Infinity */ |
2047 | tp->snd_cwnd_clamp = ~0; | 2050 | tp->snd_cwnd_clamp = ~0; |
2048 | tp->mss_cache_std = tp->mss_cache = 536; | 2051 | tp->mss_cache = 536; |
2049 | 2052 | ||
2050 | tp->reordering = sysctl_tcp_reordering; | 2053 | tp->reordering = sysctl_tcp_reordering; |
2054 | tp->ca_ops = &tcp_init_congestion_ops; | ||
2051 | 2055 | ||
2052 | sk->sk_state = TCP_CLOSE; | 2056 | sk->sk_state = TCP_CLOSE; |
2053 | 2057 | ||
@@ -2070,6 +2074,8 @@ int tcp_v4_destroy_sock(struct sock *sk) | |||
2070 | 2074 | ||
2071 | tcp_clear_xmit_timers(sk); | 2075 | tcp_clear_xmit_timers(sk); |
2072 | 2076 | ||
2077 | tcp_cleanup_congestion_control(tp); | ||
2078 | |||
2073 | /* Cleanup up the write buffer. */ | 2079 | /* Cleanup up the write buffer. */ |
2074 | sk_stream_writequeue_purge(sk); | 2080 | sk_stream_writequeue_purge(sk); |
2075 | 2081 | ||