aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/inet_connection_sock.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-10-22 08:36:53 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-22 08:39:14 -0400
commitf8ddadc4db6c7b7029b6d0e0d9af24f74ad27ca2 (patch)
tree0a6432aba336bae42313613f4c891bcfce02bd4e /net/ipv4/inet_connection_sock.c
parentbdd091bab8c631bd2801af838e344fad34566410 (diff)
parentb5ac3beb5a9f0ef0ea64cd85faf94c0dc4de0e42 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
There were quite a few overlapping sets of changes here. Daniel's bug fix for off-by-ones in the new BPF branch instructions, along with the added allowances for "data_end > ptr + x" forms collided with the metadata additions. Along with those three changes came veritifer test cases, which in their final form I tried to group together properly. If I had just trimmed GIT's conflict tags as-is, this would have split up the meta tests unnecessarily. In the socketmap code, a set of preemption disabling changes overlapped with the rename of bpf_compute_data_end() to bpf_compute_data_pointers(). Changes were made to the mv88e6060.c driver set addr method which got removed in net-next. The hyperv transport socket layer had a locking change in 'net' which overlapped with a change of socket state macro usage in 'net-next'. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/inet_connection_sock.c')
-rw-r--r--net/ipv4/inet_connection_sock.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
index 5c965ecc96a0..ca03a1dcbc8f 100644
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -475,6 +475,7 @@ struct sock *inet_csk_accept(struct sock *sk, int flags, int *err, bool kern)
475 } 475 }
476 spin_unlock_bh(&queue->fastopenq.lock); 476 spin_unlock_bh(&queue->fastopenq.lock);
477 } 477 }
478 mem_cgroup_sk_alloc(newsk);
478out: 479out:
479 release_sock(sk); 480 release_sock(sk);
480 if (req) 481 if (req)
@@ -537,9 +538,10 @@ struct dst_entry *inet_csk_route_req(const struct sock *sk,
537{ 538{
538 const struct inet_request_sock *ireq = inet_rsk(req); 539 const struct inet_request_sock *ireq = inet_rsk(req);
539 struct net *net = read_pnet(&ireq->ireq_net); 540 struct net *net = read_pnet(&ireq->ireq_net);
540 struct ip_options_rcu *opt = ireq->opt; 541 struct ip_options_rcu *opt;
541 struct rtable *rt; 542 struct rtable *rt;
542 543
544 opt = rcu_dereference(ireq->ireq_opt);
543 flowi4_init_output(fl4, ireq->ir_iif, ireq->ir_mark, 545 flowi4_init_output(fl4, ireq->ir_iif, ireq->ir_mark,
544 RT_CONN_FLAGS(sk), RT_SCOPE_UNIVERSE, 546 RT_CONN_FLAGS(sk), RT_SCOPE_UNIVERSE,
545 sk->sk_protocol, inet_sk_flowi_flags(sk), 547 sk->sk_protocol, inet_sk_flowi_flags(sk),
@@ -573,10 +575,9 @@ struct dst_entry *inet_csk_route_child_sock(const struct sock *sk,
573 struct flowi4 *fl4; 575 struct flowi4 *fl4;
574 struct rtable *rt; 576 struct rtable *rt;
575 577
578 opt = rcu_dereference(ireq->ireq_opt);
576 fl4 = &newinet->cork.fl.u.ip4; 579 fl4 = &newinet->cork.fl.u.ip4;
577 580
578 rcu_read_lock();
579 opt = rcu_dereference(newinet->inet_opt);
580 flowi4_init_output(fl4, ireq->ir_iif, ireq->ir_mark, 581 flowi4_init_output(fl4, ireq->ir_iif, ireq->ir_mark,
581 RT_CONN_FLAGS(sk), RT_SCOPE_UNIVERSE, 582 RT_CONN_FLAGS(sk), RT_SCOPE_UNIVERSE,
582 sk->sk_protocol, inet_sk_flowi_flags(sk), 583 sk->sk_protocol, inet_sk_flowi_flags(sk),
@@ -589,13 +590,11 @@ struct dst_entry *inet_csk_route_child_sock(const struct sock *sk,
589 goto no_route; 590 goto no_route;
590 if (opt && opt->opt.is_strictroute && rt->rt_uses_gateway) 591 if (opt && opt->opt.is_strictroute && rt->rt_uses_gateway)
591 goto route_err; 592 goto route_err;
592 rcu_read_unlock();
593 return &rt->dst; 593 return &rt->dst;
594 594
595route_err: 595route_err:
596 ip_rt_put(rt); 596 ip_rt_put(rt);
597no_route: 597no_route:
598 rcu_read_unlock();
599 __IP_INC_STATS(net, IPSTATS_MIB_OUTNOROUTES); 598 __IP_INC_STATS(net, IPSTATS_MIB_OUTNOROUTES);
600 return NULL; 599 return NULL;
601} 600}