From b6078715a19dff6c6a77090896b8a42d4b38b1eb Mon Sep 17 00:00:00 2001 From: bz Date: Sat, 31 Jul 2010 21:33:18 +0000 Subject: 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 --- sys/netinet/if_ether.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sys/netinet/if_ether.c') diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 08a162f..ec03268 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -163,12 +163,10 @@ static void arptimer(void *arg) { struct ifnet *ifp; - struct llentry *lle = (struct llentry *)arg; + struct llentry *lle; - if (lle == NULL) { - panic("%s: NULL entry!\n", __func__); - return; - } + KASSERT(arg != NULL, ("%s: arg NULL", __func__)); + lle = (struct llentry *)arg; ifp = lle->lle_tbl->llt_ifp; CURVNET_SET(ifp->if_vnet); IF_AFDATA_LOCK(ifp); -- cgit v1.1