diff options
author | Eric Dumazet <edumazet@google.com> | 2015-03-18 17:05:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-18 22:00:34 -0400 |
commit | d1e559d0b1b0d02f76a6bd5b768a99dc834ae926 (patch) | |
tree | 283048c1921aeec1c2dfb25e72e6e67cddffcb23 /net/ipv4/tcp_ipv4.c | |
parent | 5b441f76f1b83591e8cd9d60ba1df3a2aacde27f (diff) |
inet: add IPv6 support to sk_ehashfn()
Intent is to converge IPv4 & IPv6 inet_hash functions to
factorize code.
IPv4 sockets initialize sk_rcv_saddr and sk_v6_daddr
in this patch, thanks to new sk_daddr_set() and sk_rcv_saddr_set()
helpers.
__inet6_hash can now use sk_ehashfn() instead of a private
inet6_sk_ehashfn() and will simply use __inet_hash() in a
following patch.
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.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 80067d5858b4..ca207df4af1c 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -189,7 +189,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
189 | 189 | ||
190 | if (!inet->inet_saddr) | 190 | if (!inet->inet_saddr) |
191 | inet->inet_saddr = fl4->saddr; | 191 | inet->inet_saddr = fl4->saddr; |
192 | inet->inet_rcv_saddr = inet->inet_saddr; | 192 | sk_rcv_saddr_set(sk, inet->inet_saddr); |
193 | 193 | ||
194 | if (tp->rx_opt.ts_recent_stamp && inet->inet_daddr != daddr) { | 194 | if (tp->rx_opt.ts_recent_stamp && inet->inet_daddr != daddr) { |
195 | /* Reset inherited state */ | 195 | /* Reset inherited state */ |
@@ -204,7 +204,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
204 | tcp_fetch_timewait_stamp(sk, &rt->dst); | 204 | tcp_fetch_timewait_stamp(sk, &rt->dst); |
205 | 205 | ||
206 | inet->inet_dport = usin->sin_port; | 206 | inet->inet_dport = usin->sin_port; |
207 | inet->inet_daddr = daddr; | 207 | sk_daddr_set(sk, daddr); |
208 | 208 | ||
209 | inet_csk(sk)->icsk_ext_hdr_len = 0; | 209 | inet_csk(sk)->icsk_ext_hdr_len = 0; |
210 | if (inet_opt) | 210 | if (inet_opt) |
@@ -1319,8 +1319,8 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
1319 | newtp = tcp_sk(newsk); | 1319 | newtp = tcp_sk(newsk); |
1320 | newinet = inet_sk(newsk); | 1320 | newinet = inet_sk(newsk); |
1321 | ireq = inet_rsk(req); | 1321 | ireq = inet_rsk(req); |
1322 | newinet->inet_daddr = ireq->ir_rmt_addr; | 1322 | sk_daddr_set(newsk, ireq->ir_rmt_addr); |
1323 | newinet->inet_rcv_saddr = ireq->ir_loc_addr; | 1323 | sk_rcv_saddr_set(newsk, ireq->ir_loc_addr); |
1324 | newinet->inet_saddr = ireq->ir_loc_addr; | 1324 | newinet->inet_saddr = ireq->ir_loc_addr; |
1325 | inet_opt = ireq->opt; | 1325 | inet_opt = ireq->opt; |
1326 | rcu_assign_pointer(newinet->inet_opt, inet_opt); | 1326 | rcu_assign_pointer(newinet->inet_opt, inet_opt); |