[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 05 May 2008 15:11:20 +0200
From: Johannes Berg <johannes@...solutions.net>
To: "David S. Miller" <davem@...emloft.net>
Cc: Herbert Xu <herbert@...dor.apana.org.au>,
netdev <netdev@...r.kernel.org>
Subject: Re: [RFC/T] [NET] give truesize warning when truesize differs
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 <johannes@...solutions.net>
> Cc: Herbert Xu <herbert@...dor.apana.org.au>
> ---
> 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] [<c0274194>] __alloc_skb+0xdc/0x140
[11381.081745] [<c02aeca8>] sk_stream_alloc_skb+0x38/0x134
[11381.081758] [<c02af16c>] tcp_sendmsg+0x3c8/0xcbc
[11381.081767] [<c026bcc4>] sock_sendmsg+0xac/0xe4
[11381.081780] [<c026c058>] sys_sendto+0xbc/0xec
[11381.081790] [<c026cbc8>] sys_socketcall+0x14c/0x1dc
[11381.081800] [<c00124cc>] ret_from_syscall+0x0/0x38
johannes
Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)
Powered by blists - more mailing lists