aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ipv6.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/ipv6.c')
-rw-r--r--net/dccp/ipv6.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index d4ce1224e008..b963f35c65f6 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -168,7 +168,7 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
168 goto out; 168 goto out;
169 } 169 }
170 170
171 err = xfrm_lookup(&dst, &fl, sk, 0); 171 err = xfrm_lookup(net, &dst, &fl, sk, 0);
172 if (err < 0) { 172 if (err < 0) {
173 sk->sk_err_soft = -err; 173 sk->sk_err_soft = -err;
174 goto out; 174 goto out;
@@ -279,7 +279,7 @@ static int dccp_v6_send_response(struct sock *sk, struct request_sock *req)
279 if (final_p) 279 if (final_p)
280 ipv6_addr_copy(&fl.fl6_dst, final_p); 280 ipv6_addr_copy(&fl.fl6_dst, final_p);
281 281
282 err = xfrm_lookup(&dst, &fl, sk, 0); 282 err = xfrm_lookup(sock_net(sk), &dst, &fl, sk, 0);
283 if (err < 0) 283 if (err < 0)
284 goto done; 284 goto done;
285 285
@@ -304,6 +304,7 @@ done:
304 304
305static void dccp_v6_reqsk_destructor(struct request_sock *req) 305static void dccp_v6_reqsk_destructor(struct request_sock *req)
306{ 306{
307 dccp_feat_list_purge(&dccp_rsk(req)->dreq_featneg);
307 if (inet6_rsk(req)->pktopts != NULL) 308 if (inet6_rsk(req)->pktopts != NULL)
308 kfree_skb(inet6_rsk(req)->pktopts); 309 kfree_skb(inet6_rsk(req)->pktopts);
309} 310}
@@ -342,7 +343,7 @@ static void dccp_v6_ctl_send_reset(struct sock *sk, struct sk_buff *rxskb)
342 343
343 /* sk = NULL, but it is safe for now. RST socket required. */ 344 /* sk = NULL, but it is safe for now. RST socket required. */
344 if (!ip6_dst_lookup(ctl_sk, &skb->dst, &fl)) { 345 if (!ip6_dst_lookup(ctl_sk, &skb->dst, &fl)) {
345 if (xfrm_lookup(&skb->dst, &fl, NULL, 0) >= 0) { 346 if (xfrm_lookup(net, &skb->dst, &fl, NULL, 0) >= 0) {
346 ip6_xmit(ctl_sk, skb, &fl, NULL, 0); 347 ip6_xmit(ctl_sk, skb, &fl, NULL, 0);
347 DCCP_INC_STATS_BH(DCCP_MIB_OUTSEGS); 348 DCCP_INC_STATS_BH(DCCP_MIB_OUTSEGS);
348 DCCP_INC_STATS_BH(DCCP_MIB_OUTRSTS); 349 DCCP_INC_STATS_BH(DCCP_MIB_OUTRSTS);
@@ -426,7 +427,8 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
426 if (req == NULL) 427 if (req == NULL)
427 goto drop; 428 goto drop;
428 429
429 dccp_reqsk_init(req, skb); 430 if (dccp_reqsk_init(req, dccp_sk(sk), skb))
431 goto drop_and_free;
430 432
431 dreq = dccp_rsk(req); 433 dreq = dccp_rsk(req);
432 if (dccp_parse_options(sk, dreq, skb)) 434 if (dccp_parse_options(sk, dreq, skb))
@@ -567,7 +569,7 @@ static struct sock *dccp_v6_request_recv_sock(struct sock *sk,
567 if (final_p) 569 if (final_p)
568 ipv6_addr_copy(&fl.fl6_dst, final_p); 570 ipv6_addr_copy(&fl.fl6_dst, final_p);
569 571
570 if ((xfrm_lookup(&dst, &fl, sk, 0)) < 0) 572 if ((xfrm_lookup(sock_net(sk), &dst, &fl, sk, 0)) < 0)
571 goto out; 573 goto out;
572 } 574 }
573 575
@@ -1002,7 +1004,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
1002 if (final_p) 1004 if (final_p)
1003 ipv6_addr_copy(&fl.fl6_dst, final_p); 1005 ipv6_addr_copy(&fl.fl6_dst, final_p);
1004 1006
1005 err = __xfrm_lookup(&dst, &fl, sk, XFRM_LOOKUP_WAIT); 1007 err = __xfrm_lookup(sock_net(sk), &dst, &fl, sk, XFRM_LOOKUP_WAIT);
1006 if (err < 0) { 1008 if (err < 0) {
1007 if (err == -EREMOTE) 1009 if (err == -EREMOTE)
1008 err = ip6_dst_blackhole(sk, &dst, &fl); 1010 err = ip6_dst_blackhole(sk, &dst, &fl);
@@ -1138,6 +1140,7 @@ static struct proto dccp_v6_prot = {
1138 .orphan_count = &dccp_orphan_count, 1140 .orphan_count = &dccp_orphan_count,
1139 .max_header = MAX_DCCP_HEADER, 1141 .max_header = MAX_DCCP_HEADER,
1140 .obj_size = sizeof(struct dccp6_sock), 1142 .obj_size = sizeof(struct dccp6_sock),
1143 .slab_flags = SLAB_DESTROY_BY_RCU,
1141 .rsk_prot = &dccp6_request_sock_ops, 1144 .rsk_prot = &dccp6_request_sock_ops,
1142 .twsk_prot = &dccp6_timewait_sock_ops, 1145 .twsk_prot = &dccp6_timewait_sock_ops,
1143 .h.hashinfo = &dccp_hashinfo, 1146 .h.hashinfo = &dccp_hashinfo,