ipv6: avoid write to a possibly cloned skb

am: aed728c38c

Change-Id: I7bbff2dcff94ea2804d3f21cd0341379332a47e6
This commit is contained in:
Florian Westphal
2017-03-22 11:31:13 +00:00
committed by android-build-merger

View File

@@ -742,13 +742,14 @@ slow_path:
* Fragment the datagram.
*/
*prevhdr = NEXTHDR_FRAGMENT;
troom = rt->dst.dev->needed_tailroom;
/*
* Keep copying data until we run out.
*/
while (left > 0) {
u8 *fragnexthdr_offset;
len = left;
/* IF: it doesn't fit, use 'mtu' - the data space left */
if (len > mtu)
@@ -793,6 +794,10 @@ slow_path:
*/
skb_copy_from_linear_data(skb, skb_network_header(frag), hlen);
fragnexthdr_offset = skb_network_header(frag);
fragnexthdr_offset += prevhdr - skb_network_header(skb);
*fragnexthdr_offset = NEXTHDR_FRAGMENT;
/*
* Build fragment header.
*/