ipv6: avoid write to a possibly cloned skb

am: 683100ed45

Change-Id: If32c172adceadc53f7222c310e8f939004154687
This commit is contained in:
Florian Westphal
2017-03-22 12:00:32 +00:00
committed by android-build-merger

View File

@@ -757,13 +757,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)
@@ -808,6 +809,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.
*/