Skip to content

Commit

Permalink
ip_output: do skb ufo init for peeked non ufo skb as well
Browse files Browse the repository at this point in the history
Now, if user application does:
sendto len<mtu flag MSG_MORE
sendto len>mtu flag 0
The skb is not treated as fragmented one because it is not initialized
that way. So move the initialization to fix this.

introduced by:
commit e89e9cf "[IPv4/IPv6]: UFO Scatter-gather approach"

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
jpirko authored and davem330 committed Oct 19, 2013
1 parent c547dbf commit e93b7d7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions net/ipv4/ip_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,15 +772,20 @@ static inline int ip_ufo_append_data(struct sock *sk,
/* initialize protocol header pointer */
skb->transport_header = skb->network_header + fragheaderlen;

skb->ip_summed = CHECKSUM_PARTIAL;
skb->csum = 0;

/* specify the length of each IP datagram fragment */
skb_shinfo(skb)->gso_size = maxfraglen - fragheaderlen;
skb_shinfo(skb)->gso_type = SKB_GSO_UDP;

__skb_queue_tail(queue, skb);
} else if (skb_is_gso(skb)) {
goto append;
}

skb->ip_summed = CHECKSUM_PARTIAL;
/* specify the length of each IP datagram fragment */
skb_shinfo(skb)->gso_size = maxfraglen - fragheaderlen;
skb_shinfo(skb)->gso_type = SKB_GSO_UDP;

append:
return skb_append_datato_frags(sk, skb, getfrag, from,
(length - transhdrlen));
}
Expand Down

0 comments on commit e93b7d7

Please sign in to comment.