diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-11-08 14:23:02 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-11-08 14:23:02 -0500 |
commit | 895e031707954a9ca26ed4f5f794575313854ed1 (patch) | |
tree | ec7cd5515f346e6f94bc43e63d55ebc8ddf4173d /net/ipv4 | |
parent | 838e8bb71dc0c892bf8f84abd3c709d8fe3a8d3c (diff) | |
parent | a622cf69b806bbb1887913c04e01d0c25b892876 (diff) |
Merge branch 'linus' into x86/cleanups
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/cipso_ipv4.c | 7 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 3 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 10 | ||||
-rw-r--r-- | net/ipv4/udp.c | 12 | ||||
-rw-r--r-- | net/ipv4/xfrm4_state.c | 1 |
5 files changed, 18 insertions, 15 deletions
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c index 490e035c6d90..2e78f6bd9775 100644 --- a/net/ipv4/cipso_ipv4.c +++ b/net/ipv4/cipso_ipv4.c | |||
@@ -2063,9 +2063,10 @@ int cipso_v4_skbuff_setattr(struct sk_buff *skb, | |||
2063 | u32 opt_len; | 2063 | u32 opt_len; |
2064 | int len_delta; | 2064 | int len_delta; |
2065 | 2065 | ||
2066 | buf_len = cipso_v4_genopt(buf, buf_len, doi_def, secattr); | 2066 | ret_val = cipso_v4_genopt(buf, buf_len, doi_def, secattr); |
2067 | if (buf_len < 0) | 2067 | if (ret_val < 0) |
2068 | return buf_len; | 2068 | return ret_val; |
2069 | buf_len = ret_val; | ||
2069 | opt_len = (buf_len + 3) & ~3; | 2070 | opt_len = (buf_len + 3) & ~3; |
2070 | 2071 | ||
2071 | /* we overwrite any existing options to ensure that we have enough | 2072 | /* we overwrite any existing options to ensure that we have enough |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index eccb7165a80c..c5aca0bb116a 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -1374,8 +1374,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
1374 | sk->sk_state == TCP_CLOSE || | 1374 | sk->sk_state == TCP_CLOSE || |
1375 | (sk->sk_shutdown & RCV_SHUTDOWN) || | 1375 | (sk->sk_shutdown & RCV_SHUTDOWN) || |
1376 | !timeo || | 1376 | !timeo || |
1377 | signal_pending(current) || | 1377 | signal_pending(current)) |
1378 | (flags & MSG_PEEK)) | ||
1379 | break; | 1378 | break; |
1380 | } else { | 1379 | } else { |
1381 | if (sock_flag(sk, SOCK_DONE)) | 1380 | if (sock_flag(sk, SOCK_DONE)) |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index e4c5ac9fe89b..ba85d8831893 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -2279,6 +2279,11 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, | |||
2279 | } | 2279 | } |
2280 | 2280 | ||
2281 | memset(&opts, 0, sizeof(opts)); | 2281 | memset(&opts, 0, sizeof(opts)); |
2282 | #ifdef CONFIG_SYN_COOKIES | ||
2283 | if (unlikely(req->cookie_ts)) | ||
2284 | TCP_SKB_CB(skb)->when = cookie_init_timestamp(req); | ||
2285 | else | ||
2286 | #endif | ||
2282 | TCP_SKB_CB(skb)->when = tcp_time_stamp; | 2287 | TCP_SKB_CB(skb)->when = tcp_time_stamp; |
2283 | tcp_header_size = tcp_synack_options(sk, req, mss, | 2288 | tcp_header_size = tcp_synack_options(sk, req, mss, |
2284 | skb, &opts, &md5) + | 2289 | skb, &opts, &md5) + |
@@ -2304,11 +2309,6 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, | |||
2304 | 2309 | ||
2305 | /* RFC1323: The window in SYN & SYN/ACK segments is never scaled. */ | 2310 | /* RFC1323: The window in SYN & SYN/ACK segments is never scaled. */ |
2306 | th->window = htons(min(req->rcv_wnd, 65535U)); | 2311 | th->window = htons(min(req->rcv_wnd, 65535U)); |
2307 | #ifdef CONFIG_SYN_COOKIES | ||
2308 | if (unlikely(req->cookie_ts)) | ||
2309 | TCP_SKB_CB(skb)->when = cookie_init_timestamp(req); | ||
2310 | else | ||
2311 | #endif | ||
2312 | tcp_options_write((__be32 *)(th + 1), tp, &opts, &md5_hash_location); | 2312 | tcp_options_write((__be32 *)(th + 1), tp, &opts, &md5_hash_location); |
2313 | th->doff = (tcp_header_size >> 2); | 2313 | th->doff = (tcp_header_size >> 2); |
2314 | TCP_INC_STATS(sock_net(sk), TCP_MIB_OUTSEGS); | 2314 | TCP_INC_STATS(sock_net(sk), TCP_MIB_OUTSEGS); |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 2095abc3caba..cf02701ced48 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -284,7 +284,7 @@ struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, | |||
284 | } | 284 | } |
285 | EXPORT_SYMBOL_GPL(udp4_lib_lookup); | 285 | EXPORT_SYMBOL_GPL(udp4_lib_lookup); |
286 | 286 | ||
287 | static inline struct sock *udp_v4_mcast_next(struct sock *sk, | 287 | static inline struct sock *udp_v4_mcast_next(struct net *net, struct sock *sk, |
288 | __be16 loc_port, __be32 loc_addr, | 288 | __be16 loc_port, __be32 loc_addr, |
289 | __be16 rmt_port, __be32 rmt_addr, | 289 | __be16 rmt_port, __be32 rmt_addr, |
290 | int dif) | 290 | int dif) |
@@ -296,7 +296,8 @@ static inline struct sock *udp_v4_mcast_next(struct sock *sk, | |||
296 | sk_for_each_from(s, node) { | 296 | sk_for_each_from(s, node) { |
297 | struct inet_sock *inet = inet_sk(s); | 297 | struct inet_sock *inet = inet_sk(s); |
298 | 298 | ||
299 | if (s->sk_hash != hnum || | 299 | if (!net_eq(sock_net(s), net) || |
300 | s->sk_hash != hnum || | ||
300 | (inet->daddr && inet->daddr != rmt_addr) || | 301 | (inet->daddr && inet->daddr != rmt_addr) || |
301 | (inet->dport != rmt_port && inet->dport) || | 302 | (inet->dport != rmt_port && inet->dport) || |
302 | (inet->rcv_saddr && inet->rcv_saddr != loc_addr) || | 303 | (inet->rcv_saddr && inet->rcv_saddr != loc_addr) || |
@@ -1079,15 +1080,16 @@ static int __udp4_lib_mcast_deliver(struct net *net, struct sk_buff *skb, | |||
1079 | read_lock(&udp_hash_lock); | 1080 | read_lock(&udp_hash_lock); |
1080 | sk = sk_head(&udptable[udp_hashfn(net, ntohs(uh->dest))]); | 1081 | sk = sk_head(&udptable[udp_hashfn(net, ntohs(uh->dest))]); |
1081 | dif = skb->dev->ifindex; | 1082 | dif = skb->dev->ifindex; |
1082 | sk = udp_v4_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif); | 1083 | sk = udp_v4_mcast_next(net, sk, uh->dest, daddr, uh->source, saddr, dif); |
1083 | if (sk) { | 1084 | if (sk) { |
1084 | struct sock *sknext = NULL; | 1085 | struct sock *sknext = NULL; |
1085 | 1086 | ||
1086 | do { | 1087 | do { |
1087 | struct sk_buff *skb1 = skb; | 1088 | struct sk_buff *skb1 = skb; |
1088 | 1089 | ||
1089 | sknext = udp_v4_mcast_next(sk_next(sk), uh->dest, daddr, | 1090 | sknext = udp_v4_mcast_next(net, sk_next(sk), uh->dest, |
1090 | uh->source, saddr, dif); | 1091 | daddr, uh->source, saddr, |
1092 | dif); | ||
1091 | if (sknext) | 1093 | if (sknext) |
1092 | skb1 = skb_clone(skb, GFP_ATOMIC); | 1094 | skb1 = skb_clone(skb, GFP_ATOMIC); |
1093 | 1095 | ||
diff --git a/net/ipv4/xfrm4_state.c b/net/ipv4/xfrm4_state.c index 07735ed280d7..55dc6beab9aa 100644 --- a/net/ipv4/xfrm4_state.c +++ b/net/ipv4/xfrm4_state.c | |||
@@ -33,6 +33,7 @@ __xfrm4_init_tempsel(struct xfrm_state *x, struct flowi *fl, | |||
33 | x->sel.dport_mask = htons(0xffff); | 33 | x->sel.dport_mask = htons(0xffff); |
34 | x->sel.sport = xfrm_flowi_sport(fl); | 34 | x->sel.sport = xfrm_flowi_sport(fl); |
35 | x->sel.sport_mask = htons(0xffff); | 35 | x->sel.sport_mask = htons(0xffff); |
36 | x->sel.family = AF_INET; | ||
36 | x->sel.prefixlen_d = 32; | 37 | x->sel.prefixlen_d = 32; |
37 | x->sel.prefixlen_s = 32; | 38 | x->sel.prefixlen_s = 32; |
38 | x->sel.proto = fl->proto; | 39 | x->sel.proto = fl->proto; |