On Sat, 2008-05-03 at 18:03 +0200, Johannes Berg wrote:This was a stupid mistake, if you do it correctly it actually works and so far has only triggered a single warning on my system: [ 217.507048] SKB BUG: Invalid truesize (4294964120) size=432, sizeof(sk_buff)=176 that was with my patch though to update skb->truesize during !skb->sk pskb_expand_head() calls. johannes --- 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 - if (unlikely((int)skb->truesize < len)) + if (unlikely((int)skb->truesize != len)) skb_truesize_bug(skb); } --- everything.orig/net/core/skbuff.c 2008-05-03 16:29:23.000000000 +0200 +++ everything/net/core/skbuff.c 2008-05-04 00:31:32.000000000 +0200 @@ -151,9 +151,15 @@ void skb_under_panic(struct sk_buff *skb void skb_truesize_bug(struct sk_buff *skb) { +#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 + printk(KERN_ERR "SKB BUG: Invalid truesize (%u) " - "len=%u, sizeof(sk_buff)=%Zd\n", - skb->truesize, skb->len, sizeof(struct sk_buff)); + "size=%u, sizeof(sk_buff)=%Zd\n", + skb->truesize, len, sizeof(struct sk_buff)); } EXPORT_SYMBOL(skb_truesize_bug); -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| debian developer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 002/196] Chinese: rephrase English introduction in HOWTO |
| Jan Engelhardt | intel iommu (Re: -mm merge plans for 2.6.23) |
| Vladislav Bolkhovitin | Re: Integration of SCST in the mainstream Linux kernel |
git: | |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| Antonio Almeida | HTB accuracy for high speed |
| David Miller | [GIT]: Networking |
