diff options
Diffstat (limited to 'net/ipv6/ip6_output.c')
-rw-r--r-- | net/ipv6/ip6_output.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 5bf70b1442ea..e46048974f37 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -161,7 +161,7 @@ int ip6_output(struct sk_buff *skb) | |||
161 | int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl, | 161 | int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl, |
162 | struct ipv6_txoptions *opt, int ipfragok) | 162 | struct ipv6_txoptions *opt, int ipfragok) |
163 | { | 163 | { |
164 | struct ipv6_pinfo *np = sk ? inet6_sk(sk) : NULL; | 164 | struct ipv6_pinfo *np = inet6_sk(sk); |
165 | struct in6_addr *first_hop = &fl->fl6_dst; | 165 | struct in6_addr *first_hop = &fl->fl6_dst; |
166 | struct dst_entry *dst = skb->dst; | 166 | struct dst_entry *dst = skb->dst; |
167 | struct ipv6hdr *hdr; | 167 | struct ipv6hdr *hdr; |
@@ -733,28 +733,29 @@ int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi *fl) | |||
733 | if (*dst) { | 733 | if (*dst) { |
734 | struct rt6_info *rt = (struct rt6_info*)*dst; | 734 | struct rt6_info *rt = (struct rt6_info*)*dst; |
735 | 735 | ||
736 | /* Yes, checking route validity in not connected | 736 | /* Yes, checking route validity in not connected |
737 | case is not very simple. Take into account, | 737 | * case is not very simple. Take into account, |
738 | that we do not support routing by source, TOS, | 738 | * that we do not support routing by source, TOS, |
739 | and MSG_DONTROUTE --ANK (980726) | 739 | * and MSG_DONTROUTE --ANK (980726) |
740 | 740 | * | |
741 | 1. If route was host route, check that | 741 | * 1. If route was host route, check that |
742 | cached destination is current. | 742 | * cached destination is current. |
743 | If it is network route, we still may | 743 | * If it is network route, we still may |
744 | check its validity using saved pointer | 744 | * check its validity using saved pointer |
745 | to the last used address: daddr_cache. | 745 | * to the last used address: daddr_cache. |
746 | We do not want to save whole address now, | 746 | * We do not want to save whole address now, |
747 | (because main consumer of this service | 747 | * (because main consumer of this service |
748 | is tcp, which has not this problem), | 748 | * is tcp, which has not this problem), |
749 | so that the last trick works only on connected | 749 | * so that the last trick works only on connected |
750 | sockets. | 750 | * sockets. |
751 | 2. oif also should be the same. | 751 | * 2. oif also should be the same. |
752 | */ | 752 | */ |
753 | |||
754 | if (((rt->rt6i_dst.plen != 128 || | 753 | if (((rt->rt6i_dst.plen != 128 || |
755 | !ipv6_addr_equal(&fl->fl6_dst, &rt->rt6i_dst.addr)) | 754 | !ipv6_addr_equal(&fl->fl6_dst, |
755 | &rt->rt6i_dst.addr)) | ||
756 | && (np->daddr_cache == NULL || | 756 | && (np->daddr_cache == NULL || |
757 | !ipv6_addr_equal(&fl->fl6_dst, np->daddr_cache))) | 757 | !ipv6_addr_equal(&fl->fl6_dst, |
758 | np->daddr_cache))) | ||
758 | || (fl->oif && fl->oif != (*dst)->dev->ifindex)) { | 759 | || (fl->oif && fl->oif != (*dst)->dev->ifindex)) { |
759 | dst_release(*dst); | 760 | dst_release(*dst); |
760 | *dst = NULL; | 761 | *dst = NULL; |
@@ -889,7 +890,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, | |||
889 | np->cork.hop_limit = hlimit; | 890 | np->cork.hop_limit = hlimit; |
890 | np->cork.tclass = tclass; | 891 | np->cork.tclass = tclass; |
891 | mtu = dst_mtu(rt->u.dst.path); | 892 | mtu = dst_mtu(rt->u.dst.path); |
892 | if (np && np->frag_size < mtu) { | 893 | if (np->frag_size < mtu) { |
893 | if (np->frag_size) | 894 | if (np->frag_size) |
894 | mtu = np->frag_size; | 895 | mtu = np->frag_size; |
895 | } | 896 | } |