aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-03-19 22:04:19 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-20 12:40:25 -0400
commit52452c542559ac980b48dbf22a30ee7fa0af507c (patch)
treea212dbe95694ea11e86b9d9aca8a2eba0b06a2d1 /net/ipv4/tcp_ipv4.c
parenta998f712f77ea4892d3fcf24e0a67603e63da128 (diff)
inet: drop prev pointer handling in request sock
When request sock are put in ehash table, the whole notion of having a previous request to update dl_next is pointless. Also, following patch will get rid of big purge timer, so we want to delete a request sock without holding listener lock. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r--net/ipv4/tcp_ipv4.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index ddd0b1f25b96..19c3770f1e97 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -458,12 +458,12 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
458 } 458 }
459 459
460 switch (sk->sk_state) { 460 switch (sk->sk_state) {
461 struct request_sock *req, **prev; 461 struct request_sock *req;
462 case TCP_LISTEN: 462 case TCP_LISTEN:
463 if (sock_owned_by_user(sk)) 463 if (sock_owned_by_user(sk))
464 goto out; 464 goto out;
465 465
466 req = inet_csk_search_req(sk, &prev, th->dest, 466 req = inet_csk_search_req(sk, th->dest,
467 iph->daddr, iph->saddr); 467 iph->daddr, iph->saddr);
468 if (!req) 468 if (!req)
469 goto out; 469 goto out;
@@ -484,7 +484,7 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
484 * created socket, and POSIX does not want network 484 * created socket, and POSIX does not want network
485 * errors returned from accept(). 485 * errors returned from accept().
486 */ 486 */
487 inet_csk_reqsk_queue_drop(sk, req, prev); 487 inet_csk_reqsk_queue_drop(sk, req);
488 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS); 488 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
489 goto out; 489 goto out;
490 490
@@ -1392,15 +1392,14 @@ EXPORT_SYMBOL(tcp_v4_syn_recv_sock);
1392 1392
1393static struct sock *tcp_v4_hnd_req(struct sock *sk, struct sk_buff *skb) 1393static struct sock *tcp_v4_hnd_req(struct sock *sk, struct sk_buff *skb)
1394{ 1394{
1395 struct tcphdr *th = tcp_hdr(skb); 1395 const struct tcphdr *th = tcp_hdr(skb);
1396 const struct iphdr *iph = ip_hdr(skb); 1396 const struct iphdr *iph = ip_hdr(skb);
1397 struct request_sock *req;
1397 struct sock *nsk; 1398 struct sock *nsk;
1398 struct request_sock **prev; 1399
1399 /* Find possible connection requests. */ 1400 req = inet_csk_search_req(sk, th->source, iph->saddr, iph->daddr);
1400 struct request_sock *req = inet_csk_search_req(sk, &prev, th->source,
1401 iph->saddr, iph->daddr);
1402 if (req) 1401 if (req)
1403 return tcp_check_req(sk, skb, req, prev, false); 1402 return tcp_check_req(sk, skb, req, false);
1404 1403
1405 nsk = inet_lookup_established(sock_net(sk), &tcp_hashinfo, iph->saddr, 1404 nsk = inet_lookup_established(sock_net(sk), &tcp_hashinfo, iph->saddr,
1406 th->source, iph->daddr, th->dest, inet_iif(skb)); 1405 th->source, iph->daddr, th->dest, inet_iif(skb));