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

Commit 5185db09 authored by David S. Miller's avatar David S. Miller
Browse files

[LLC]: Use pskb_trim_rcsum() in llc_fixup_skb().



Kernel Bugzilla #6409

If we use plain skb_trim(), that's wrong, because if
the SKB is cloned, and it can be because we unshared
it in the caller, we have to allow reallocation.  The
pskb_trim*() family of routines is therefore the most
appropriate here.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3672558c
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -118,7 +118,8 @@ static inline int llc_fixup_skb(struct sk_buff *skb)
		u16 pdulen = eth_hdr(skb)->h_proto,
		u16 pdulen = eth_hdr(skb)->h_proto,
		    data_size = ntohs(pdulen) - llc_len;
		    data_size = ntohs(pdulen) - llc_len;


		skb_trim(skb, data_size);
		if (unlikely(pskb_trim_rcsum(skb, data_size)))
			return 0;
	}
	}
	return 1;
	return 1;
}
}