Author: kmacy
Date: Tue Dec 16 02:05:11 2008
New Revision: 186156
URL: http://svn.freebsd.org/changeset/base/186156

Log:
  need to check that lle is not null before unlock if the break condition is 
not met
  also fix the break condition to explicitly check against NULL

Modified:
  head/sys/netinet6/nd6_rtr.c

Modified: head/sys/netinet6/nd6_rtr.c
==============================================================================
--- head/sys/netinet6/nd6_rtr.c Tue Dec 16 01:58:30 2008        (r186155)
+++ head/sys/netinet6/nd6_rtr.c Tue Dec 16 02:05:11 2008        (r186156)
@@ -1333,13 +1333,14 @@ find_pfxlist_reachable_router(struct nd_
        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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to