The HyperNews Linux KHG Discussion Pages

Feedback: skb= ((struct sk_buff *)(bptr+size)) - 1;

Forum: Network Buffers And Memory Management
Re: Question question about alloc_skb in core/net/skbuff.c (Radu Duta)
Keywords: alloc_skb kmalloc
Date: Fri, 10 Apr 1998 20:44:55 GMT
From: ranjit kumar <ranjit@legato.com>

The line skb=(struct sk_buff *)(bptr+size)-1;

should ideally say skb= ((struct sk_buff *)(bptr+size)) - 1;

ie subtract one from a pointer to sk_buff. If you subtract one from a sk_buff pointer pointing to bptr+size you will get a pointer to a sk_buff just before the end. -Ranjit