Skip to content

Commit

Permalink
[LLC]: Use pskb_trim_rcsum() in llc_fixup_skb().
Browse files Browse the repository at this point in the history
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: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Apr 19, 2006
1 parent 3672558 commit 5185db0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/llc/llc_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ static inline int llc_fixup_skb(struct sk_buff *skb)
u16 pdulen = eth_hdr(skb)->h_proto,
data_size = ntohs(pdulen) - llc_len;

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

0 comments on commit 5185db0

Please sign in to comment.