diff options
Diffstat (limited to 'net/ipv6/af_inet6.c')
-rw-r--r-- | net/ipv6/af_inet6.c | 51 |
1 files changed, 22 insertions, 29 deletions
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 978e80e2c4a8..afcc7099f96d 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -644,41 +644,34 @@ EXPORT_SYMBOL(inet6_unregister_protosw); | |||
644 | 644 | ||
645 | int inet6_sk_rebuild_header(struct sock *sk) | 645 | int inet6_sk_rebuild_header(struct sock *sk) |
646 | { | 646 | { |
647 | int err; | ||
648 | struct dst_entry *dst; | ||
649 | struct ipv6_pinfo *np = inet6_sk(sk); | 647 | struct ipv6_pinfo *np = inet6_sk(sk); |
648 | struct dst_entry *dst; | ||
650 | 649 | ||
651 | dst = __sk_dst_check(sk, np->dst_cookie); | 650 | dst = __sk_dst_check(sk, np->dst_cookie); |
652 | 651 | ||
653 | if (dst == NULL) { | 652 | if (dst == NULL) { |
654 | struct inet_sock *inet = inet_sk(sk); | 653 | struct inet_sock *inet = inet_sk(sk); |
655 | struct in6_addr *final_p, final; | 654 | struct in6_addr *final_p, final; |
656 | struct flowi fl; | 655 | struct flowi6 fl6; |
657 | 656 | ||
658 | memset(&fl, 0, sizeof(fl)); | 657 | memset(&fl6, 0, sizeof(fl6)); |
659 | fl.proto = sk->sk_protocol; | 658 | fl6.flowi6_proto = sk->sk_protocol; |
660 | ipv6_addr_copy(&fl.fl6_dst, &np->daddr); | 659 | ipv6_addr_copy(&fl6.daddr, &np->daddr); |
661 | ipv6_addr_copy(&fl.fl6_src, &np->saddr); | 660 | ipv6_addr_copy(&fl6.saddr, &np->saddr); |
662 | fl.fl6_flowlabel = np->flow_label; | 661 | fl6.flowlabel = np->flow_label; |
663 | fl.oif = sk->sk_bound_dev_if; | 662 | fl6.flowi6_oif = sk->sk_bound_dev_if; |
664 | fl.mark = sk->sk_mark; | 663 | fl6.flowi6_mark = sk->sk_mark; |
665 | fl.fl_ip_dport = inet->inet_dport; | 664 | fl6.fl6_dport = inet->inet_dport; |
666 | fl.fl_ip_sport = inet->inet_sport; | 665 | fl6.fl6_sport = inet->inet_sport; |
667 | security_sk_classify_flow(sk, &fl); | 666 | security_sk_classify_flow(sk, flowi6_to_flowi(&fl6)); |
668 | 667 | ||
669 | final_p = fl6_update_dst(&fl, np->opt, &final); | 668 | final_p = fl6_update_dst(&fl6, np->opt, &final); |
670 | 669 | ||
671 | err = ip6_dst_lookup(sk, &dst, &fl); | 670 | dst = ip6_dst_lookup_flow(sk, &fl6, final_p, false); |
672 | if (err) { | 671 | if (IS_ERR(dst)) { |
673 | sk->sk_route_caps = 0; | 672 | sk->sk_route_caps = 0; |
674 | return err; | 673 | sk->sk_err_soft = -PTR_ERR(dst); |
675 | } | 674 | return PTR_ERR(dst); |
676 | if (final_p) | ||
677 | ipv6_addr_copy(&fl.fl6_dst, final_p); | ||
678 | |||
679 | if ((err = xfrm_lookup(sock_net(sk), &dst, &fl, sk, 0)) < 0) { | ||
680 | sk->sk_err_soft = -err; | ||
681 | return err; | ||
682 | } | 675 | } |
683 | 676 | ||
684 | __ip6_dst_store(sk, dst, NULL, NULL); | 677 | __ip6_dst_store(sk, dst, NULL, NULL); |
@@ -772,7 +765,7 @@ out: | |||
772 | return err; | 765 | return err; |
773 | } | 766 | } |
774 | 767 | ||
775 | static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, int features) | 768 | static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, u32 features) |
776 | { | 769 | { |
777 | struct sk_buff *segs = ERR_PTR(-EINVAL); | 770 | struct sk_buff *segs = ERR_PTR(-EINVAL); |
778 | struct ipv6hdr *ipv6h; | 771 | struct ipv6hdr *ipv6h; |
@@ -1120,7 +1113,7 @@ static int __init inet6_init(void) | |||
1120 | /* | 1113 | /* |
1121 | * ipngwg API draft makes clear that the correct semantics | 1114 | * ipngwg API draft makes clear that the correct semantics |
1122 | * for TCP and UDP is to consider one TCP and UDP instance | 1115 | * for TCP and UDP is to consider one TCP and UDP instance |
1123 | * in a host availiable by both INET and INET6 APIs and | 1116 | * in a host available by both INET and INET6 APIs and |
1124 | * able to communicate via both network protocols. | 1117 | * able to communicate via both network protocols. |
1125 | */ | 1118 | */ |
1126 | 1119 | ||