Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Feb 2002 17:44:53 -0600
From:      Maxime Henrion <mux@sneakerz.org>
To:        freebsd-arch@freebsd.org
Cc:        Brooks Davis <brooks@one-eyed-alien.net>
Subject:   Re: Patches to if_loop + the interface cloning framework
Message-ID:  <20020212174453.C25374@sneakerz.org>
In-Reply-To: <20020212153609.D24768@Odin.AC.HMC.Edu>; from brooks@one-eyed-alien.net on Tue, Feb 12, 2002 at 03:36:09PM -0800
References:  <20020212154828.A25374@sneakerz.org> <20020212143909.B24768@Odin.AC.HMC.Edu> <20020212165544.B25374@sneakerz.org> <20020212153609.D24768@Odin.AC.HMC.Edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Brooks Davis (brooks@one-eyed-alien.net) wrote:
> On Tue, Feb 12, 2002 at 04:55:44PM -0600, Maxime Henrion wrote:
> > Brooks Davis (brooks@one-eyed-alien.net) wrote:
> > > By and large it looks good so far.  I've got a couple minor issues
> > > though.  First, I think we should at least KASSERT and probably
> > > just panic if lo_clone_create() failes in loop_modevent since that
> > > causes the same problem as deleting lo0.
> > 
> > I see your concern but this raises some other questions : if it is so
> > bad that we have to panic if we're not be able to create the lo0 interface,
> > then why do we have if_loop available as a module at all ? I'm all for
> > having a KASSERT() or a panic() in that case, but I'd rather see it in a
> > SYSINIT after having removed KLD support.
> 
> You can't make if_loop a module because the kernel will have an unresolved
> symbol (loif) if you do at this point.  The main reasion I suggested a
> panic was that, you'd know immediatly that you didn't have a loopback
> device.  It looks to me like you'll quickly derefrence a NULL pointer in
> one of the IPv6 SYSINITs if you don't have a valid loif.

OK, I wasn't aware of this.

> At the very least there needs to be a printf here saying allocation
> failed.  I'd argue that there's pretty much no chance of recovery if it
> does because that's the result of failing to malloc a pretty minimal
> amount of memory and thus that a panic is the right thing to do, but
> I guess I don't care that much.  Now that I look at the code again,
> locreate() does no error checking what so ever which is probably a
> bigger issue (and not your fault).

I've updated the patch at the same location, adding a panic() in case
the creation of lo0 fails.  I'll be interested in removing the KLD
stuff from this file since it's not working anyway, and adds some error
checking, but that will be a bit later ;-)

Thanks,
Maxime Henrion

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020212174453.C25374>