diff options
author | bz <bz@FreeBSD.org> | 2010-07-31 21:33:18 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2010-07-31 21:33:18 +0000 |
commit | b6078715a19dff6c6a77090896b8a42d4b38b1eb (patch) | |
tree | cdadf0914bca15734e3e81120382c89e6432e96c /sys/netinet6 | |
parent | be2c32910f9c27fff0bb5e10fd1e7d4e986ee438 (diff) | |
download | FreeBSD-src-b6078715a19dff6c6a77090896b8a42d4b38b1eb.zip FreeBSD-src-b6078715a19dff6c6a77090896b8a42d4b38b1eb.tar.gz |
Document the mandatory argument to the arptimer() and
nd6_llinfo_timer() functions with a KASSERT().
Note: there is no need to return after panic.
In the legacy IP case, only assign the arg after the check,
in the IPv6 case, remove the extra checks for the table and
interface as they have to be there unless we freed and forgot
to cancel the timer. It doesn't matter anyway as we would
panic on the NULL pointer deref immediately and the bug is
elsewhere.
This unifies the code of both address families to some extend.
Reviewed by: rwatson
MFC after: 6 days
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/nd6.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 7a54226..e9081c4 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -446,14 +446,9 @@ nd6_llinfo_timer(void *arg) struct ifnet *ifp; struct nd_ifinfo *ndi = NULL; + KASSERT(arg != NULL, ("%s: arg NULL", __func__)); ln = (struct llentry *)arg; - if (ln == NULL) { - panic("%s: NULL entry!\n", __func__); - return; - } - - if ((ifp = ((ln->lle_tbl != NULL) ? ln->lle_tbl->llt_ifp : NULL)) == NULL) - panic("ln ifp == NULL"); + ifp = ln->lle_tbl->llt_ifp; CURVNET_SET(ifp->if_vnet); |