On Sun, 2008-05-04 at 20:12 +0200, Johannes Berg wrote: > This patch makes the truesize warning be printed when the truesize > actually changed, not just when the header was increased and the > additional size actually used. > > Signed-off-by: Johannes Berg > Cc: Herbert Xu > --- > It'll trigger with mac80211, should hold it until I fixed that. > > include/linux/skbuff.h | 8 ++++++-- > net/core/skbuff.c | 10 ++++++++-- > 2 files changed, 14 insertions(+), 4 deletions(-) > > --- everything.orig/include/linux/skbuff.h 2008-05-03 15:47:00.000000000 +0200 > +++ everything/include/linux/skbuff.h 2008-05-04 00:30:34.000000000 +0200 > @@ -387,9 +387,13 @@ extern void skb_truesize_bug(struc > > static inline void skb_truesize_check(struct sk_buff *skb) > { > - int len = sizeof(struct sk_buff) + skb->len; > +#ifdef NET_SKBUFF_DATA_USES_OFFSET > + int len = sizeof(struct sk_buff) + skb->end; > +#else > + int len = sizeof(struct sk_buff) + (skb->end - skb->head); > +#endif Umm, is this even correct? Should it check data_len? I seem to get the truesize warning a bit now: [11381.081709] SKB BUG: Invalid truesize (16864) size=4112, sizeof(sk_buff)=272 [11381.081725] last reallocate at: [11381.081729] [] __alloc_skb+0xdc/0x140 [11381.081745] [] sk_stream_alloc_skb+0x38/0x134 [11381.081758] [] tcp_sendmsg+0x3c8/0xcbc [11381.081767] [] sock_sendmsg+0xac/0xe4 [11381.081780] [] sys_sendto+0xbc/0xec [11381.081790] [] sys_socketcall+0x14c/0x1dc [11381.081800] [] ret_from_syscall+0x0/0x38 johannes