netdev
[Top] [All Lists]

Re: skb_pull, etc. panics.

To: Ben Greear <greearb@xxxxxxxxxxxxxxx>
Subject: Re: skb_pull, etc. panics.
From: Richard Guy Briggs <rgb@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 13 Jun 2001 18:22:55 -0400
Cc: Richard Guy Briggs <rgb@xxxxxxxxxxxxxxxxxxxxx>, Andi Kleen <ak@xxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <3B2791AC.7EAEC35A@candelatech.com>; from greearb@candelatech.com on Wed, Jun 13, 2001 at 09:15:40AM -0700
References: <20010606141145.L31244@grendel.conscoop.ottawa.on.ca> <20010613032126.B5323@fred.local> <20010613115848.A19894@grendel.conscoop.ottawa.on.ca> <3B2791AC.7EAEC35A@candelatech.com>
Sender: owner-netdev@xxxxxxxxxxx
User-agent: Mutt/1.2.5i
On Wed, Jun 13, 2001 at 09:15:40AM -0700, Ben Greear wrote:
> Richard Guy Briggs wrote:
> > 
> > On Wed, Jun 13, 2001 at 03:21:26AM +0200, Andi Kleen wrote:
> > > On Wed, Jun 06, 2001 at 08:11:45PM +0200, Richard Guy Briggs wrote:
> > > > Hi again,
> > > >
> > > > If this is an FAQ, can someone point me to the reasons that skb_push()
> > > > and skb_put() panic rather than dropping the skb and complaining in the
> > > > log?
> > > >
> > > > If not, why does it do that?
> > >
> > > Because an overflow or underflow is always a bug in the code. If you're
> > > not sure if the skb has enough room you have to use *_expand_headroom and
> > > friends.
> > 
> > ...so checking for it is considered debugging code and thus, overhead
> > that need not be in a production system?
> 
> In certain cases you may have to clone and grow the skb.  But, since that
> is inneficient, you should only do that in wierd boundary cases at most,
> and in general, you should make sure the skb has enough reserved space
> from the beginning.  netdevice.h has some macro magic that figures out
> the max-header (ie what to reserve).  If you can determine how much you
> need, you can change it there...

That doesn't help much if I need to add nested IPSec headers...

> Ben
> 
> -- 
> Ben Greear <greearb@xxxxxxxxxxxxxxx>          <Ben_Greear@xxxxxxxxxx>
> President of Candela Technologies Inc      http://www.candelatech.com
> ScryMUD:  http://scry.wanfear.com     http://scry.wanfear.com/~greear

        slainte mhath, RGB
-- 
Richard Guy Briggs -- PGP key available            Auto-Free Ottawa! Canada
<www.conscoop.ottawa.on.ca/rgb/>                       <www.flora.org/afo/>
Prevent Internet Wiretapping!        --        FreeS/WAN:<www.freeswan.org>
Thanks for voting Green! -- <green.ca>      Marillion:<www.marillion.co.uk>

<Prev in Thread] Current Thread [Next in Thread>