summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/nd6_rtr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet6/nd6_rtr.c')
-rw-r--r--sys/netinet6/nd6_rtr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index 6c4f145..bc1ccc6 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -1333,13 +1333,14 @@ find_pfxlist_reachable_router(struct nd_prefix *pr)
for (pfxrtr = LIST_FIRST(&pr->ndpr_advrtrs); pfxrtr;
pfxrtr = LIST_NEXT(pfxrtr, pfr_entry)) {
IF_AFDATA_LOCK(pfxrtr->router->ifp);
- if ((ln = nd6_lookup(&pfxrtr->router->rtaddr, 0,
- pfxrtr->router->ifp)) &&
+ if (((ln = nd6_lookup(&pfxrtr->router->rtaddr, 0,
+ pfxrtr->router->ifp)) != NULL) &&
ND6_IS_LLINFO_PROBREACH(ln)) {
LLE_RUNLOCK(ln);
break; /* found */
}
- LLE_RUNLOCK(ln);
+ if (ln != NULL)
+ LLE_RUNLOCK(ln);
IF_AFDATA_UNLOCK(pfxrtr->router->ifp);
}
return (pfxrtr);
OpenPOWER on IntegriCloud