diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/af_inet.c | 2 | ||||
-rw-r--r-- | net/ipv4/esp4.c | 2 | ||||
-rw-r--r-- | net/ipv4/ip_sockglue.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipconfig.c | 9 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 12 |
5 files changed, 18 insertions, 9 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 4cb8a1385539..44f5ce1fbfa4 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -458,7 +458,7 @@ int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
458 | err = -EADDRNOTAVAIL; | 458 | err = -EADDRNOTAVAIL; |
459 | if (!sysctl_ip_nonlocal_bind && | 459 | if (!sysctl_ip_nonlocal_bind && |
460 | !inet->freebind && | 460 | !inet->freebind && |
461 | addr->sin_addr.s_addr != INADDR_ANY && | 461 | addr->sin_addr.s_addr != htonl(INADDR_ANY) && |
462 | chk_addr_ret != RTN_LOCAL && | 462 | chk_addr_ret != RTN_LOCAL && |
463 | chk_addr_ret != RTN_MULTICAST && | 463 | chk_addr_ret != RTN_MULTICAST && |
464 | chk_addr_ret != RTN_BROADCAST) | 464 | chk_addr_ret != RTN_BROADCAST) |
diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index 091e6709f831..f3ceca31aa45 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c | |||
@@ -168,7 +168,7 @@ static int esp_output(struct xfrm_state *x, struct sk_buff *skb) | |||
168 | struct xfrm_encap_tmpl *encap = x->encap; | 168 | struct xfrm_encap_tmpl *encap = x->encap; |
169 | struct udphdr *uh; | 169 | struct udphdr *uh; |
170 | __be32 *udpdata32; | 170 | __be32 *udpdata32; |
171 | unsigned int sport, dport; | 171 | __be16 sport, dport; |
172 | int encap_type; | 172 | int encap_type; |
173 | 173 | ||
174 | spin_lock_bh(&x->lock); | 174 | spin_lock_bh(&x->lock); |
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index e7c9e4e72327..bb3cbe5ec36d 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -583,7 +583,7 @@ static int do_ip_setsockopt(struct sock *sk, int level, | |||
583 | } | 583 | } |
584 | 584 | ||
585 | if (!mreq.imr_ifindex) { | 585 | if (!mreq.imr_ifindex) { |
586 | if (mreq.imr_address.s_addr == INADDR_ANY) { | 586 | if (mreq.imr_address.s_addr == htonl(INADDR_ANY)) { |
587 | inet->mc_index = 0; | 587 | inet->mc_index = 0; |
588 | inet->mc_addr = 0; | 588 | inet->mc_addr = 0; |
589 | err = 0; | 589 | err = 0; |
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index 4afce0572806..96138b128de8 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
@@ -103,6 +103,7 @@ | |||
103 | - '3' from resolv.h */ | 103 | - '3' from resolv.h */ |
104 | 104 | ||
105 | #define NONE __constant_htonl(INADDR_NONE) | 105 | #define NONE __constant_htonl(INADDR_NONE) |
106 | #define ANY __constant_htonl(INADDR_ANY) | ||
106 | 107 | ||
107 | /* | 108 | /* |
108 | * Public IP configuration | 109 | * Public IP configuration |
@@ -1476,19 +1477,19 @@ static int __init ip_auto_config_setup(char *addrs) | |||
1476 | DBG(("IP-Config: Parameter #%d: `%s'\n", num, ip)); | 1477 | DBG(("IP-Config: Parameter #%d: `%s'\n", num, ip)); |
1477 | switch (num) { | 1478 | switch (num) { |
1478 | case 0: | 1479 | case 0: |
1479 | if ((ic_myaddr = in_aton(ip)) == INADDR_ANY) | 1480 | if ((ic_myaddr = in_aton(ip)) == ANY) |
1480 | ic_myaddr = NONE; | 1481 | ic_myaddr = NONE; |
1481 | break; | 1482 | break; |
1482 | case 1: | 1483 | case 1: |
1483 | if ((ic_servaddr = in_aton(ip)) == INADDR_ANY) | 1484 | if ((ic_servaddr = in_aton(ip)) == ANY) |
1484 | ic_servaddr = NONE; | 1485 | ic_servaddr = NONE; |
1485 | break; | 1486 | break; |
1486 | case 2: | 1487 | case 2: |
1487 | if ((ic_gateway = in_aton(ip)) == INADDR_ANY) | 1488 | if ((ic_gateway = in_aton(ip)) == ANY) |
1488 | ic_gateway = NONE; | 1489 | ic_gateway = NONE; |
1489 | break; | 1490 | break; |
1490 | case 3: | 1491 | case 3: |
1491 | if ((ic_netmask = in_aton(ip)) == INADDR_ANY) | 1492 | if ((ic_netmask = in_aton(ip)) == ANY) |
1492 | ic_netmask = NONE; | 1493 | ic_netmask = NONE; |
1493 | break; | 1494 | break; |
1494 | case 4: | 1495 | case 4: |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index cbfef8b1f5e8..67f84f5035c4 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -1035,6 +1035,13 @@ static void tcp_cwnd_validate(struct sock *sk) | |||
1035 | * introducing MSS oddities to segment boundaries. In rare cases where | 1035 | * introducing MSS oddities to segment boundaries. In rare cases where |
1036 | * mss_now != mss_cache, we will request caller to create a small skb | 1036 | * mss_now != mss_cache, we will request caller to create a small skb |
1037 | * per input skb which could be mostly avoided here (if desired). | 1037 | * per input skb which could be mostly avoided here (if desired). |
1038 | * | ||
1039 | * We explicitly want to create a request for splitting write queue tail | ||
1040 | * to a small skb for Nagle purposes while avoiding unnecessary modulos, | ||
1041 | * thus all the complexity (cwnd_len is always MSS multiple which we | ||
1042 | * return whenever allowed by the other factors). Basically we need the | ||
1043 | * modulo only when the receiver window alone is the limiting factor or | ||
1044 | * when we would be allowed to send the split-due-to-Nagle skb fully. | ||
1038 | */ | 1045 | */ |
1039 | static unsigned int tcp_mss_split_point(struct sock *sk, struct sk_buff *skb, | 1046 | static unsigned int tcp_mss_split_point(struct sock *sk, struct sk_buff *skb, |
1040 | unsigned int mss_now, unsigned int cwnd) | 1047 | unsigned int mss_now, unsigned int cwnd) |
@@ -1048,10 +1055,11 @@ static unsigned int tcp_mss_split_point(struct sock *sk, struct sk_buff *skb, | |||
1048 | if (likely(cwnd_len <= window && skb != tcp_write_queue_tail(sk))) | 1055 | if (likely(cwnd_len <= window && skb != tcp_write_queue_tail(sk))) |
1049 | return cwnd_len; | 1056 | return cwnd_len; |
1050 | 1057 | ||
1051 | if (skb == tcp_write_queue_tail(sk) && cwnd_len <= skb->len) | 1058 | needed = min(skb->len, window); |
1059 | |||
1060 | if (skb == tcp_write_queue_tail(sk) && cwnd_len <= needed) | ||
1052 | return cwnd_len; | 1061 | return cwnd_len; |
1053 | 1062 | ||
1054 | needed = min(skb->len, window); | ||
1055 | return needed - needed % mss_now; | 1063 | return needed - needed % mss_now; |
1056 | } | 1064 | } |
1057 | 1065 | ||