check return from lla_lookup against NULL not zero

This commit is contained in:
Kip Macy 2008-12-16 02:30:42 +00:00
parent 56c423b065
commit 688d079b2d
2 changed files with 2 additions and 2 deletions

View File

@ -1593,7 +1593,7 @@ in6_ifinit(struct ifnet *ifp, struct in6_ifaddr *ia,
ln = lla_lookup(LLTABLE6(ifp), (LLE_CREATE | LLE_IFADDR | LLE_EXCLUSIVE),
(struct sockaddr *)&ia->ia_addr);
IF_AFDATA_UNLOCK(ifp);
if (ln) {
if (ln != NULL) {
ln->la_expire = 0; /* for IPv6 this means permanent */
ln->ln_state = ND6_LLINFO_REACHABLE;
LLE_WUNLOCK(ln);

View File

@ -574,7 +574,7 @@ selectroute(struct sockaddr_in6 *dstsock, struct ip6_pktopts *opts,
IF_AFDATA_LOCK(ifp);
la = lla_lookup(LLTABLE6(ifp), 0, (struct sockaddr *)&sin6_next->sin6_addr);
IF_AFDATA_UNLOCK(ifp);
if (la)
if (la != NULL)
LLE_RUNLOCK(la);
else {
error = EHOSTUNREACH;