tcp: factorize sk_txhash init
authorEric Dumazet <edumazet@google.com>
Wed, 23 Sep 2015 03:44:17 +0000 (20:44 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Sep 2015 21:52:30 +0000 (14:52 -0700)
Neal suggested to move sk_txhash init into tcp_create_openreq_child(),
called both from IPv4 and IPv6.

This opportunity was missed in commit 58d607d3e52f ("tcp: provide
skb->hash to synack packets")

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_minisocks.c
net/ipv6/tcp_ipv6.c

index d671d742a2398d04ce2d6f5126ab941a36bbc1cc..7e26465423129755732ba7a03f8fd5347a79fa6a 100644 (file)
@@ -1276,7 +1276,6 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
        newinet->mc_index     = inet_iif(skb);
        newinet->mc_ttl       = ip_hdr(skb)->ttl;
        newinet->rcv_tos      = ip_hdr(skb)->tos;
-       newsk->sk_txhash      = tcp_rsk(req)->txhash;
        inet_csk(newsk)->icsk_ext_hdr_len = 0;
        if (inet_opt)
                inet_csk(newsk)->icsk_ext_hdr_len = inet_opt->opt.optlen;
index 10933d01b982137b113f49497c6a971513e27aae..85830bb92d04df82d4417fa45deb6d1af46ec9f9 100644 (file)
@@ -471,6 +471,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req,
                tcp_enable_early_retrans(newtp);
                newtp->tlp_high_seq = 0;
                newtp->lsndtime = treq->snt_synack.stamp_jiffies;
+               newsk->sk_txhash = treq->txhash;
                newtp->last_oow_ack_time = 0;
                newtp->total_retrans = req->num_retrans;
 
index f9c0e264067104260ed586836364da10019851aa..a004e0b0b3e961b3a5fdcc5babb8d2ea065bf5b9 100644 (file)
@@ -1090,8 +1090,6 @@ static struct sock *tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
        newsk->sk_v6_rcv_saddr = ireq->ir_v6_loc_addr;
        newsk->sk_bound_dev_if = ireq->ir_iif;
 
-       newsk->sk_txhash = tcp_rsk(req)->txhash;
-
        /* Now IPv6 options...
 
           First: no IPv4 options.