diff options
author | Tom Herbert <tom@herbertland.com> | 2015-07-28 19:02:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-07-30 01:44:04 -0400 |
commit | 877d1f6291f8e391237e324be58479a3e3a7407c (patch) | |
tree | 7fef04aed6fab396e8e1205a37fff6ad3a2450ed /net/ipv4/tcp_ipv4.c | |
parent | 7a86d96e4a990aab2fc7b3b97c3bb09f9da0a290 (diff) |
net: Set sk_txhash from a random number
This patch creates sk_set_txhash and eliminates protocol specific
inet_set_txhash and ip6_set_txhash. sk_set_txhash simply sets a
random number instead of performing flow dissection. sk_set_txash
is also allowed to be called multiple times for the same socket,
we'll need this when redoing the hash for negative routing advice.
Signed-off-by: Tom Herbert <tom@herbertland.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.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 486ba96ae91a..d27eb549ced6 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -222,7 +222,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
222 | if (err) | 222 | if (err) |
223 | goto failure; | 223 | goto failure; |
224 | 224 | ||
225 | inet_set_txhash(sk); | 225 | sk_set_txhash(sk); |
226 | 226 | ||
227 | rt = ip_route_newports(fl4, rt, orig_sport, orig_dport, | 227 | rt = ip_route_newports(fl4, rt, orig_sport, orig_dport, |
228 | inet->inet_sport, inet->inet_dport, sk); | 228 | inet->inet_sport, inet->inet_dport, sk); |
@@ -1277,7 +1277,7 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
1277 | newinet->mc_ttl = ip_hdr(skb)->ttl; | 1277 | newinet->mc_ttl = ip_hdr(skb)->ttl; |
1278 | newinet->rcv_tos = ip_hdr(skb)->tos; | 1278 | newinet->rcv_tos = ip_hdr(skb)->tos; |
1279 | inet_csk(newsk)->icsk_ext_hdr_len = 0; | 1279 | inet_csk(newsk)->icsk_ext_hdr_len = 0; |
1280 | inet_set_txhash(newsk); | 1280 | sk_set_txhash(newsk); |
1281 | if (inet_opt) | 1281 | if (inet_opt) |
1282 | inet_csk(newsk)->icsk_ext_hdr_len = inet_opt->opt.optlen; | 1282 | inet_csk(newsk)->icsk_ext_hdr_len = inet_opt->opt.optlen; |
1283 | newinet->inet_id = newtp->write_seq ^ jiffies; | 1283 | newinet->inet_id = newtp->write_seq ^ jiffies; |