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/ipv6/tcp_ipv6.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/ipv6/tcp_ipv6.c')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index e4761b22307b..5546df074583 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -233,11 +233,8 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, | |||
233 | tp->af_specific = &tcp_sock_ipv6_specific; | 233 | tp->af_specific = &tcp_sock_ipv6_specific; |
234 | #endif | 234 | #endif |
235 | goto failure; | 235 | goto failure; |
236 | } else { | ||
237 | ipv6_addr_set_v4mapped(inet->inet_saddr, &np->saddr); | ||
238 | ipv6_addr_set_v4mapped(inet->inet_rcv_saddr, | ||
239 | &sk->sk_v6_rcv_saddr); | ||
240 | } | 236 | } |
237 | np->saddr = sk->sk_v6_rcv_saddr; | ||
241 | 238 | ||
242 | return err; | 239 | return err; |
243 | } | 240 | } |
@@ -1078,11 +1075,7 @@ static struct sock *tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
1078 | 1075 | ||
1079 | memcpy(newnp, np, sizeof(struct ipv6_pinfo)); | 1076 | memcpy(newnp, np, sizeof(struct ipv6_pinfo)); |
1080 | 1077 | ||
1081 | ipv6_addr_set_v4mapped(newinet->inet_daddr, &newsk->sk_v6_daddr); | 1078 | newnp->saddr = newsk->sk_v6_rcv_saddr; |
1082 | |||
1083 | ipv6_addr_set_v4mapped(newinet->inet_saddr, &newnp->saddr); | ||
1084 | |||
1085 | newsk->sk_v6_rcv_saddr = newnp->saddr; | ||
1086 | 1079 | ||
1087 | inet_csk(newsk)->icsk_af_ops = &ipv6_mapped; | 1080 | inet_csk(newsk)->icsk_af_ops = &ipv6_mapped; |
1088 | newsk->sk_backlog_rcv = tcp_v4_do_rcv; | 1081 | newsk->sk_backlog_rcv = tcp_v4_do_rcv; |