diff options
Diffstat (limited to 'net/ipv6/ip6_output.c')
-rw-r--r-- | net/ipv6/ip6_output.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 84d0bd5cac93..a24e15557843 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -238,8 +238,8 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6, | |||
238 | hdr->nexthdr = proto; | 238 | hdr->nexthdr = proto; |
239 | hdr->hop_limit = hlimit; | 239 | hdr->hop_limit = hlimit; |
240 | 240 | ||
241 | ipv6_addr_copy(&hdr->saddr, &fl6->saddr); | 241 | hdr->saddr = fl6->saddr; |
242 | ipv6_addr_copy(&hdr->daddr, first_hop); | 242 | hdr->daddr = *first_hop; |
243 | 243 | ||
244 | skb->priority = sk->sk_priority; | 244 | skb->priority = sk->sk_priority; |
245 | skb->mark = sk->sk_mark; | 245 | skb->mark = sk->sk_mark; |
@@ -290,8 +290,8 @@ int ip6_nd_hdr(struct sock *sk, struct sk_buff *skb, struct net_device *dev, | |||
290 | hdr->nexthdr = proto; | 290 | hdr->nexthdr = proto; |
291 | hdr->hop_limit = np->hop_limit; | 291 | hdr->hop_limit = np->hop_limit; |
292 | 292 | ||
293 | ipv6_addr_copy(&hdr->saddr, saddr); | 293 | hdr->saddr = *saddr; |
294 | ipv6_addr_copy(&hdr->daddr, daddr); | 294 | hdr->daddr = *daddr; |
295 | 295 | ||
296 | return 0; | 296 | return 0; |
297 | } | 297 | } |
@@ -631,6 +631,7 @@ int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)) | |||
631 | struct ipv6hdr *tmp_hdr; | 631 | struct ipv6hdr *tmp_hdr; |
632 | struct frag_hdr *fh; | 632 | struct frag_hdr *fh; |
633 | unsigned int mtu, hlen, left, len; | 633 | unsigned int mtu, hlen, left, len; |
634 | int hroom, troom; | ||
634 | __be32 frag_id = 0; | 635 | __be32 frag_id = 0; |
635 | int ptr, offset = 0, err=0; | 636 | int ptr, offset = 0, err=0; |
636 | u8 *prevhdr, nexthdr = 0; | 637 | u8 *prevhdr, nexthdr = 0; |
@@ -797,6 +798,8 @@ slow_path: | |||
797 | */ | 798 | */ |
798 | 799 | ||
799 | *prevhdr = NEXTHDR_FRAGMENT; | 800 | *prevhdr = NEXTHDR_FRAGMENT; |
801 | hroom = LL_RESERVED_SPACE(rt->dst.dev); | ||
802 | troom = rt->dst.dev->needed_tailroom; | ||
800 | 803 | ||
801 | /* | 804 | /* |
802 | * Keep copying data until we run out. | 805 | * Keep copying data until we run out. |
@@ -815,7 +818,8 @@ slow_path: | |||
815 | * Allocate buffer. | 818 | * Allocate buffer. |
816 | */ | 819 | */ |
817 | 820 | ||
818 | if ((frag = alloc_skb(len+hlen+sizeof(struct frag_hdr)+LL_ALLOCATED_SPACE(rt->dst.dev), GFP_ATOMIC)) == NULL) { | 821 | if ((frag = alloc_skb(len + hlen + sizeof(struct frag_hdr) + |
822 | hroom + troom, GFP_ATOMIC)) == NULL) { | ||
819 | NETDEBUG(KERN_INFO "IPv6: frag: no memory for new fragment!\n"); | 823 | NETDEBUG(KERN_INFO "IPv6: frag: no memory for new fragment!\n"); |
820 | IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), | 824 | IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), |
821 | IPSTATS_MIB_FRAGFAILS); | 825 | IPSTATS_MIB_FRAGFAILS); |
@@ -828,7 +832,7 @@ slow_path: | |||
828 | */ | 832 | */ |
829 | 833 | ||
830 | ip6_copy_metadata(frag, skb); | 834 | ip6_copy_metadata(frag, skb); |
831 | skb_reserve(frag, LL_RESERVED_SPACE(rt->dst.dev)); | 835 | skb_reserve(frag, hroom); |
832 | skb_put(frag, len + hlen + sizeof(struct frag_hdr)); | 836 | skb_put(frag, len + hlen + sizeof(struct frag_hdr)); |
833 | skb_reset_network_header(frag); | 837 | skb_reset_network_header(frag); |
834 | fh = (struct frag_hdr *)(skb_network_header(frag) + hlen); | 838 | fh = (struct frag_hdr *)(skb_network_header(frag) + hlen); |
@@ -1059,7 +1063,7 @@ struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, | |||
1059 | if (err) | 1063 | if (err) |
1060 | return ERR_PTR(err); | 1064 | return ERR_PTR(err); |
1061 | if (final_dst) | 1065 | if (final_dst) |
1062 | ipv6_addr_copy(&fl6->daddr, final_dst); | 1066 | fl6->daddr = *final_dst; |
1063 | if (can_sleep) | 1067 | if (can_sleep) |
1064 | fl6->flowi6_flags |= FLOWI_FLAG_CAN_SLEEP; | 1068 | fl6->flowi6_flags |= FLOWI_FLAG_CAN_SLEEP; |
1065 | 1069 | ||
@@ -1095,7 +1099,7 @@ struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, | |||
1095 | if (err) | 1099 | if (err) |
1096 | return ERR_PTR(err); | 1100 | return ERR_PTR(err); |
1097 | if (final_dst) | 1101 | if (final_dst) |
1098 | ipv6_addr_copy(&fl6->daddr, final_dst); | 1102 | fl6->daddr = *final_dst; |
1099 | if (can_sleep) | 1103 | if (can_sleep) |
1100 | fl6->flowi6_flags |= FLOWI_FLAG_CAN_SLEEP; | 1104 | fl6->flowi6_flags |= FLOWI_FLAG_CAN_SLEEP; |
1101 | 1105 | ||
@@ -1588,7 +1592,7 @@ int ip6_push_pending_frames(struct sock *sk) | |||
1588 | if (np->pmtudisc < IPV6_PMTUDISC_DO) | 1592 | if (np->pmtudisc < IPV6_PMTUDISC_DO) |
1589 | skb->local_df = 1; | 1593 | skb->local_df = 1; |
1590 | 1594 | ||
1591 | ipv6_addr_copy(final_dst, &fl6->daddr); | 1595 | *final_dst = fl6->daddr; |
1592 | __skb_pull(skb, skb_network_header_len(skb)); | 1596 | __skb_pull(skb, skb_network_header_len(skb)); |
1593 | if (opt && opt->opt_flen) | 1597 | if (opt && opt->opt_flen) |
1594 | ipv6_push_frag_opts(skb, opt, &proto); | 1598 | ipv6_push_frag_opts(skb, opt, &proto); |
@@ -1604,8 +1608,8 @@ int ip6_push_pending_frames(struct sock *sk) | |||
1604 | 1608 | ||
1605 | hdr->hop_limit = np->cork.hop_limit; | 1609 | hdr->hop_limit = np->cork.hop_limit; |
1606 | hdr->nexthdr = proto; | 1610 | hdr->nexthdr = proto; |
1607 | ipv6_addr_copy(&hdr->saddr, &fl6->saddr); | 1611 | hdr->saddr = fl6->saddr; |
1608 | ipv6_addr_copy(&hdr->daddr, final_dst); | 1612 | hdr->daddr = *final_dst; |
1609 | 1613 | ||
1610 | skb->priority = sk->sk_priority; | 1614 | skb->priority = sk->sk_priority; |
1611 | skb->mark = sk->sk_mark; | 1615 | skb->mark = sk->sk_mark; |