Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Feb 2004 17:09:25 +0100
From:      Andre Oppermann <andre@freebsd.org>
To:        Bruce M Simpson <bms@spc.org>
Cc:        cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/netinet ip_icmp.c
Message-ID:  <401FC7B5.D2B9BD52@freebsd.org>
References:  <200402022253.i12MrGkO091411@repoman.freebsd.org> <20040202232614.GA24019@Odin.AC.HMC.Edu> <401EE109.D45B606@freebsd.org> <20040203000622.GA19568@Odin.AC.HMC.Edu> <20040203122436.GE713@saboteur.dek.spc.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Bruce M Simpson wrote:
> 
> On Mon, Feb 02, 2004 at 04:06:22PM -0800, Brooks Davis wrote:
> > I'm not sugguesting caching the ifp.  I'm suggesting storing the value
> > of ifp->if_index.  You then use ifnet_byindex to get then the ifp when
> > needed.  You have to check that it isn't NULL, but you should to be
> > doing that for the ifunit() call as well since it will return NULL and
> > cause a panic if the admin makes a typo.
> 
> Good catch. Thanks.

In the code I committed the case of an invalid interface name (or typo)
is correctly handled and will not panic the system.  I tested that as
one of the first things when I wrote that code. ;)

At the moment I'm changing it to use the ifindex method Brooks suggests.

-- 
Andre



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