Commit bf159569 authored by Brian Haley's avatar Brian Haley Committed by Hideaki Yoshifuji

[IPV6] Lookup appropriate destination when sending TCPv6 with routing header.

Signed-off-by: default avatarBrian Haley <Brian.Haley@hp.com>
Signed-off-by: default avatarHideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
parent 319c3e85
...@@ -1802,6 +1802,7 @@ static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok) ...@@ -1802,6 +1802,7 @@ static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok)
struct ipv6_pinfo *np = inet6_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk);
struct flowi fl; struct flowi fl;
struct dst_entry *dst; struct dst_entry *dst;
struct in6_addr *final_p = NULL, final;
memset(&fl, 0, sizeof(fl)); memset(&fl, 0, sizeof(fl));
fl.proto = IPPROTO_TCP; fl.proto = IPPROTO_TCP;
...@@ -1815,7 +1816,9 @@ static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok) ...@@ -1815,7 +1816,9 @@ static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok)
if (np->opt && np->opt->srcrt) { if (np->opt && np->opt->srcrt) {
struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt; struct rt0_hdr *rt0 = (struct rt0_hdr *) np->opt->srcrt;
ipv6_addr_copy(&final, &fl.fl6_dst);
ipv6_addr_copy(&fl.fl6_dst, rt0->addr); ipv6_addr_copy(&fl.fl6_dst, rt0->addr);
final_p = &final;
} }
dst = __sk_dst_check(sk, np->dst_cookie); dst = __sk_dst_check(sk, np->dst_cookie);
...@@ -1828,6 +1831,9 @@ static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok) ...@@ -1828,6 +1831,9 @@ static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok)
return err; return err;
} }
if (final_p)
ipv6_addr_copy(&fl.fl6_dst, final_p);
if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) { if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) {
sk->sk_route_caps = 0; sk->sk_route_caps = 0;
dst_release(dst); dst_release(dst);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment