aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2006-08-29 20:15:09 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-22 17:55:45 -0400
commit8e1ef0a95b87e8b4292b2ba733e8cb854ea2d2fe (patch)
tree245489015b33604df5b270ce3c027205d867a929 /net/ipv6
parentcf6b1982599cbb60f410adeda659b0b29cdf7ad7 (diff)
[IPV6]: Cache source address as well in ipv6_pinfo{}.
Based on MIPL2 kernel patch. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: Ville Nuorvala <vnuorval@tcs.hut.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/af_inet6.c2
-rw-r--r--net/ipv6/datagram.c7
-rw-r--r--net/ipv6/inet6_connection_sock.c2
-rw-r--r--net/ipv6/ip6_output.c3
-rw-r--r--net/ipv6/tcp_ipv6.c4
-rw-r--r--net/ipv6/udp.c7
6 files changed, 19 insertions, 6 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 2ff600cfe3a4..57ee5ddea96f 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -659,7 +659,7 @@ int inet6_sk_rebuild_header(struct sock *sk)
659 return err; 659 return err;
660 } 660 }
661 661
662 __ip6_dst_store(sk, dst, NULL); 662 __ip6_dst_store(sk, dst, NULL, NULL);
663 } 663 }
664 664
665 return 0; 665 return 0;
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index c73508e090a6..8561b9da6db6 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -193,7 +193,12 @@ ipv4_connected:
193 193
194 ip6_dst_store(sk, dst, 194 ip6_dst_store(sk, dst,
195 ipv6_addr_equal(&fl.fl6_dst, &np->daddr) ? 195 ipv6_addr_equal(&fl.fl6_dst, &np->daddr) ?
196 &np->daddr : NULL); 196 &np->daddr : NULL,
197#ifdef CONFIG_IPV6_SUBTREES
198 ipv6_addr_equal(&fl.fl6_src, &np->saddr) ?
199 &np->saddr :
200#endif
201 NULL);
197 202
198 sk->sk_state = TCP_ESTABLISHED; 203 sk->sk_state = TCP_ESTABLISHED;
199out: 204out:
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index 7a51a258615d..827f41d1478b 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -186,7 +186,7 @@ int inet6_csk_xmit(struct sk_buff *skb, int ipfragok)
186 return err; 186 return err;
187 } 187 }
188 188
189 __ip6_dst_store(sk, dst, NULL); 189 __ip6_dst_store(sk, dst, NULL, NULL);
190 } 190 }
191 191
192 skb->dst = dst_clone(dst); 192 skb->dst = dst_clone(dst);
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 0a18cb6b1cbb..2a376b7d91b4 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -762,6 +762,9 @@ static struct dst_entry *ip6_sk_dst_check(struct sock *sk,
762 * 2. oif also should be the same. 762 * 2. oif also should be the same.
763 */ 763 */
764 if (ip6_rt_check(&rt->rt6i_dst, &fl->fl6_dst, np->daddr_cache) || 764 if (ip6_rt_check(&rt->rt6i_dst, &fl->fl6_dst, np->daddr_cache) ||
765#ifdef CONFIG_IPV6_SUBTREES
766 ip6_rt_check(&rt->rt6i_src, &fl->fl6_src, np->saddr_cache) ||
767#endif
765 (fl->oif && fl->oif != dst->dev->ifindex)) { 768 (fl->oif && fl->oif != dst->dev->ifindex)) {
766 dst_release(dst); 769 dst_release(dst);
767 dst = NULL; 770 dst = NULL;
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 7f1b660493b7..2b18918f3011 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -272,7 +272,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
272 inet->rcv_saddr = LOOPBACK4_IPV6; 272 inet->rcv_saddr = LOOPBACK4_IPV6;
273 273
274 sk->sk_gso_type = SKB_GSO_TCPV6; 274 sk->sk_gso_type = SKB_GSO_TCPV6;
275 __ip6_dst_store(sk, dst, NULL); 275 __ip6_dst_store(sk, dst, NULL, NULL);
276 276
277 icsk->icsk_ext_hdr_len = 0; 277 icsk->icsk_ext_hdr_len = 0;
278 if (np->opt) 278 if (np->opt)
@@ -954,7 +954,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
954 */ 954 */
955 955
956 newsk->sk_gso_type = SKB_GSO_TCPV6; 956 newsk->sk_gso_type = SKB_GSO_TCPV6;
957 __ip6_dst_store(newsk, dst, NULL); 957 __ip6_dst_store(newsk, dst, NULL, NULL);
958 958
959 newtcp6sk = (struct tcp6_sock *)newsk; 959 newtcp6sk = (struct tcp6_sock *)newsk;
960 inet_sk(newsk)->pinet6 = &newtcp6sk->inet6; 960 inet_sk(newsk)->pinet6 = &newtcp6sk->inet6;
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index eb9e1b39c8f8..b9cc55ccb000 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -847,7 +847,12 @@ do_append_data:
847 if (connected) { 847 if (connected) {
848 ip6_dst_store(sk, dst, 848 ip6_dst_store(sk, dst,
849 ipv6_addr_equal(&fl->fl6_dst, &np->daddr) ? 849 ipv6_addr_equal(&fl->fl6_dst, &np->daddr) ?
850 &np->daddr : NULL); 850 &np->daddr : NULL,
851#ifdef CONFIG_IPV6_SUBTREES
852 ipv6_addr_equal(&fl->fl6_src, &np->saddr) ?
853 &np->saddr :
854#endif
855 NULL);
851 } else { 856 } else {
852 dst_release(dst); 857 dst_release(dst);
853 } 858 }