cvs commit: src/sys/netinet ip_icmp.c
Andre Oppermann
andre at freebsd.org
Tue Feb 3 08:09:34 PST 2004
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
More information about the cvs-src
mailing list