Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e93b7d74 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

ip_output: do skb ufo init for peeked non ufo skb as well



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 e89e9cf5 "[IPv4/IPv6]: UFO Scatter-gather approach"

Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c547dbf5
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -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;


		__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;
		__skb_queue_tail(queue, skb);
	}

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