diff options
author | Eric Dumazet <edumazet@google.com> | 2015-03-12 19:44:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-12 22:58:12 -0400 |
commit | bd337c581b2b0d933d37f664bf55b342577fed3a (patch) | |
tree | ec450b42ebb3369f46c64f63a43a3915053205c6 /net | |
parent | 54720df130b3e6356391ed4f8a1a024318bcae23 (diff) |
ipv6: add missing ireq_net & ir_cookie initializations
I forgot to update dccp_v6_conn_request() & cookie_v6_check().
They both need to set ireq->ireq_net and ireq->ir_cookie
Lets clear ireq->ir_cookie in inet_reqsk_alloc()
Signed-off-by: Eric Dumazet <edumazet@google.com>
Fixes: 33cf7c90fe2f ("net: add real socket cookies")
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/dccp/ipv4.c | 1 | ||||
-rw-r--r-- | net/dccp/ipv6.c | 1 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 1 | ||||
-rw-r--r-- | net/ipv6/syncookies.c | 1 |
4 files changed, 2 insertions, 2 deletions
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index a78e0b999f96..f695874b5ade 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
@@ -642,7 +642,6 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
642 | ireq->ir_loc_addr = ip_hdr(skb)->daddr; | 642 | ireq->ir_loc_addr = ip_hdr(skb)->daddr; |
643 | ireq->ir_rmt_addr = ip_hdr(skb)->saddr; | 643 | ireq->ir_rmt_addr = ip_hdr(skb)->saddr; |
644 | write_pnet(&ireq->ireq_net, sock_net(sk)); | 644 | write_pnet(&ireq->ireq_net, sock_net(sk)); |
645 | atomic64_set(&ireq->ir_cookie, 0); | ||
646 | 645 | ||
647 | /* | 646 | /* |
648 | * Step 3: Process LISTEN state | 647 | * Step 3: Process LISTEN state |
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 6bcaa33cd804..703a21acf434 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
@@ -403,6 +403,7 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | |||
403 | ireq = inet_rsk(req); | 403 | ireq = inet_rsk(req); |
404 | ireq->ir_v6_rmt_addr = ipv6_hdr(skb)->saddr; | 404 | ireq->ir_v6_rmt_addr = ipv6_hdr(skb)->saddr; |
405 | ireq->ir_v6_loc_addr = ipv6_hdr(skb)->daddr; | 405 | ireq->ir_v6_loc_addr = ipv6_hdr(skb)->daddr; |
406 | write_pnet(&ireq->ireq_net, sock_net(sk)); | ||
406 | 407 | ||
407 | if (ipv6_opt_accepted(sk, skb, IP6CB(skb)) || | 408 | if (ipv6_opt_accepted(sk, skb, IP6CB(skb)) || |
408 | np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo || | 409 | np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo || |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 26f24995bd3d..da61a8e75f68 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -5966,7 +5966,6 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops, | |||
5966 | tmp_opt.tstamp_ok = tmp_opt.saw_tstamp; | 5966 | tmp_opt.tstamp_ok = tmp_opt.saw_tstamp; |
5967 | tcp_openreq_init(req, &tmp_opt, skb, sk); | 5967 | tcp_openreq_init(req, &tmp_opt, skb, sk); |
5968 | write_pnet(&inet_rsk(req)->ireq_net, sock_net(sk)); | 5968 | write_pnet(&inet_rsk(req)->ireq_net, sock_net(sk)); |
5969 | atomic64_set(&inet_rsk(req)->ir_cookie, 0); | ||
5970 | 5969 | ||
5971 | af_ops->init_req(req, sk, skb); | 5970 | af_ops->init_req(req, sk, skb); |
5972 | 5971 | ||
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c index 7337fc7947e2..66bba6a84e47 100644 --- a/net/ipv6/syncookies.c +++ b/net/ipv6/syncookies.c | |||
@@ -196,6 +196,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) | |||
196 | ireq = inet_rsk(req); | 196 | ireq = inet_rsk(req); |
197 | treq = tcp_rsk(req); | 197 | treq = tcp_rsk(req); |
198 | treq->listener = NULL; | 198 | treq->listener = NULL; |
199 | write_pnet(&ireq->ireq_net, sock_net(sk)); | ||
199 | 200 | ||
200 | if (security_inet_conn_request(sk, skb, req)) | 201 | if (security_inet_conn_request(sk, skb, req)) |
201 | goto out_free; | 202 | goto out_free; |