diff options
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r-- | net/ipv4/ip_output.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 9ee17e3d11c3..3982eabf61e1 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -148,7 +148,7 @@ int ip_build_and_send_pkt(struct sk_buff *skb, struct sock *sk, | |||
148 | iph->daddr = (opt && opt->opt.srr ? opt->opt.faddr : daddr); | 148 | iph->daddr = (opt && opt->opt.srr ? opt->opt.faddr : daddr); |
149 | iph->saddr = saddr; | 149 | iph->saddr = saddr; |
150 | iph->protocol = sk->sk_protocol; | 150 | iph->protocol = sk->sk_protocol; |
151 | ip_select_ident(iph, &rt->dst, sk); | 151 | ip_select_ident(skb, &rt->dst, sk); |
152 | 152 | ||
153 | if (opt && opt->opt.optlen) { | 153 | if (opt && opt->opt.optlen) { |
154 | iph->ihl += opt->opt.optlen>>2; | 154 | iph->ihl += opt->opt.optlen>>2; |
@@ -386,7 +386,7 @@ packet_routed: | |||
386 | ip_options_build(skb, &inet_opt->opt, inet->inet_daddr, rt, 0); | 386 | ip_options_build(skb, &inet_opt->opt, inet->inet_daddr, rt, 0); |
387 | } | 387 | } |
388 | 388 | ||
389 | ip_select_ident_more(iph, &rt->dst, sk, | 389 | ip_select_ident_more(skb, &rt->dst, sk, |
390 | (skb_shinfo(skb)->gso_segs ?: 1) - 1); | 390 | (skb_shinfo(skb)->gso_segs ?: 1) - 1); |
391 | 391 | ||
392 | skb->priority = sk->sk_priority; | 392 | skb->priority = sk->sk_priority; |
@@ -772,15 +772,20 @@ static inline int ip_ufo_append_data(struct sock *sk, | |||
772 | /* initialize protocol header pointer */ | 772 | /* initialize protocol header pointer */ |
773 | skb->transport_header = skb->network_header + fragheaderlen; | 773 | skb->transport_header = skb->network_header + fragheaderlen; |
774 | 774 | ||
775 | skb->ip_summed = CHECKSUM_PARTIAL; | ||
776 | skb->csum = 0; | 775 | skb->csum = 0; |
777 | 776 | ||
778 | /* specify the length of each IP datagram fragment */ | 777 | |
779 | skb_shinfo(skb)->gso_size = maxfraglen - fragheaderlen; | ||
780 | skb_shinfo(skb)->gso_type = SKB_GSO_UDP; | ||
781 | __skb_queue_tail(queue, skb); | 778 | __skb_queue_tail(queue, skb); |
779 | } else if (skb_is_gso(skb)) { | ||
780 | goto append; | ||
782 | } | 781 | } |
783 | 782 | ||
783 | skb->ip_summed = CHECKSUM_PARTIAL; | ||
784 | /* specify the length of each IP datagram fragment */ | ||
785 | skb_shinfo(skb)->gso_size = maxfraglen - fragheaderlen; | ||
786 | skb_shinfo(skb)->gso_type = SKB_GSO_UDP; | ||
787 | |||
788 | append: | ||
784 | return skb_append_datato_frags(sk, skb, getfrag, from, | 789 | return skb_append_datato_frags(sk, skb, getfrag, from, |
785 | (length - transhdrlen)); | 790 | (length - transhdrlen)); |
786 | } | 791 | } |
@@ -1316,7 +1321,7 @@ struct sk_buff *__ip_make_skb(struct sock *sk, | |||
1316 | else | 1321 | else |
1317 | ttl = ip_select_ttl(inet, &rt->dst); | 1322 | ttl = ip_select_ttl(inet, &rt->dst); |
1318 | 1323 | ||
1319 | iph = (struct iphdr *)skb->data; | 1324 | iph = ip_hdr(skb); |
1320 | iph->version = 4; | 1325 | iph->version = 4; |
1321 | iph->ihl = 5; | 1326 | iph->ihl = 5; |
1322 | iph->tos = inet->tos; | 1327 | iph->tos = inet->tos; |
@@ -1324,7 +1329,7 @@ struct sk_buff *__ip_make_skb(struct sock *sk, | |||
1324 | iph->ttl = ttl; | 1329 | iph->ttl = ttl; |
1325 | iph->protocol = sk->sk_protocol; | 1330 | iph->protocol = sk->sk_protocol; |
1326 | ip_copy_addrs(iph, fl4); | 1331 | ip_copy_addrs(iph, fl4); |
1327 | ip_select_ident(iph, &rt->dst, sk); | 1332 | ip_select_ident(skb, &rt->dst, sk); |
1328 | 1333 | ||
1329 | if (opt) { | 1334 | if (opt) { |
1330 | iph->ihl += opt->optlen>>2; | 1335 | iph->ihl += opt->optlen>>2; |