diff options
Diffstat (limited to 'net/ipv6/ip6_output.c')
-rw-r--r-- | net/ipv6/ip6_output.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index a54c45ce4a48..91fb4e8212f5 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -105,7 +105,7 @@ static int ip6_finish_output2(struct sk_buff *skb) | |||
105 | } | 105 | } |
106 | 106 | ||
107 | rcu_read_lock_bh(); | 107 | rcu_read_lock_bh(); |
108 | nexthop = rt6_nexthop((struct rt6_info *)dst, &ipv6_hdr(skb)->daddr); | 108 | nexthop = rt6_nexthop((struct rt6_info *)dst); |
109 | neigh = __ipv6_neigh_lookup_noref(dst->dev, nexthop); | 109 | neigh = __ipv6_neigh_lookup_noref(dst->dev, nexthop); |
110 | if (unlikely(!neigh)) | 110 | if (unlikely(!neigh)) |
111 | neigh = __neigh_create(&nd_tbl, nexthop, dst->dev, false); | 111 | neigh = __neigh_create(&nd_tbl, nexthop, dst->dev, false); |
@@ -874,7 +874,7 @@ static int ip6_dst_lookup_tail(struct sock *sk, | |||
874 | */ | 874 | */ |
875 | rt = (struct rt6_info *) *dst; | 875 | rt = (struct rt6_info *) *dst; |
876 | rcu_read_lock_bh(); | 876 | rcu_read_lock_bh(); |
877 | n = __ipv6_neigh_lookup_noref(rt->dst.dev, rt6_nexthop(rt, &fl6->daddr)); | 877 | n = __ipv6_neigh_lookup_noref(rt->dst.dev, rt6_nexthop(rt)); |
878 | err = n && !(n->nud_state & NUD_VALID) ? -EINVAL : 0; | 878 | err = n && !(n->nud_state & NUD_VALID) ? -EINVAL : 0; |
879 | rcu_read_unlock_bh(); | 879 | rcu_read_unlock_bh(); |
880 | 880 | ||
@@ -1008,6 +1008,7 @@ static inline int ip6_ufo_append_data(struct sock *sk, | |||
1008 | 1008 | ||
1009 | { | 1009 | { |
1010 | struct sk_buff *skb; | 1010 | struct sk_buff *skb; |
1011 | struct frag_hdr fhdr; | ||
1011 | int err; | 1012 | int err; |
1012 | 1013 | ||
1013 | /* There is support for UDP large send offload by network | 1014 | /* There is support for UDP large send offload by network |
@@ -1015,8 +1016,6 @@ static inline int ip6_ufo_append_data(struct sock *sk, | |||
1015 | * udp datagram | 1016 | * udp datagram |
1016 | */ | 1017 | */ |
1017 | if ((skb = skb_peek_tail(&sk->sk_write_queue)) == NULL) { | 1018 | if ((skb = skb_peek_tail(&sk->sk_write_queue)) == NULL) { |
1018 | struct frag_hdr fhdr; | ||
1019 | |||
1020 | skb = sock_alloc_send_skb(sk, | 1019 | skb = sock_alloc_send_skb(sk, |
1021 | hh_len + fragheaderlen + transhdrlen + 20, | 1020 | hh_len + fragheaderlen + transhdrlen + 20, |
1022 | (flags & MSG_DONTWAIT), &err); | 1021 | (flags & MSG_DONTWAIT), &err); |
@@ -1036,20 +1035,24 @@ static inline int ip6_ufo_append_data(struct sock *sk, | |||
1036 | skb->transport_header = skb->network_header + fragheaderlen; | 1035 | skb->transport_header = skb->network_header + fragheaderlen; |
1037 | 1036 | ||
1038 | skb->protocol = htons(ETH_P_IPV6); | 1037 | skb->protocol = htons(ETH_P_IPV6); |
1039 | skb->ip_summed = CHECKSUM_PARTIAL; | ||
1040 | skb->csum = 0; | 1038 | skb->csum = 0; |
1041 | 1039 | ||
1042 | /* Specify the length of each IPv6 datagram fragment. | ||
1043 | * It has to be a multiple of 8. | ||
1044 | */ | ||
1045 | skb_shinfo(skb)->gso_size = (mtu - fragheaderlen - | ||
1046 | sizeof(struct frag_hdr)) & ~7; | ||
1047 | skb_shinfo(skb)->gso_type = SKB_GSO_UDP; | ||
1048 | ipv6_select_ident(&fhdr, rt); | ||
1049 | skb_shinfo(skb)->ip6_frag_id = fhdr.identification; | ||
1050 | __skb_queue_tail(&sk->sk_write_queue, skb); | 1040 | __skb_queue_tail(&sk->sk_write_queue, skb); |
1041 | } else if (skb_is_gso(skb)) { | ||
1042 | goto append; | ||
1051 | } | 1043 | } |
1052 | 1044 | ||
1045 | skb->ip_summed = CHECKSUM_PARTIAL; | ||
1046 | /* Specify the length of each IPv6 datagram fragment. | ||
1047 | * It has to be a multiple of 8. | ||
1048 | */ | ||
1049 | skb_shinfo(skb)->gso_size = (mtu - fragheaderlen - | ||
1050 | sizeof(struct frag_hdr)) & ~7; | ||
1051 | skb_shinfo(skb)->gso_type = SKB_GSO_UDP; | ||
1052 | ipv6_select_ident(&fhdr, rt); | ||
1053 | skb_shinfo(skb)->ip6_frag_id = fhdr.identification; | ||
1054 | |||
1055 | append: | ||
1053 | return skb_append_datato_frags(sk, skb, getfrag, from, | 1056 | return skb_append_datato_frags(sk, skb, getfrag, from, |
1054 | (length - transhdrlen)); | 1057 | (length - transhdrlen)); |
1055 | } | 1058 | } |