summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/nd6_rtr.c
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2008-12-16 23:56:24 +0000
committerkmacy <kmacy@FreeBSD.org>2008-12-16 23:56:24 +0000
commit43e7c1af8b2db7fbcfc5f57130190bc06d3eb7ae (patch)
tree7563247d42c687ec176e3b91ed1b9391aa78b088 /sys/netinet6/nd6_rtr.c
parent697e2a94e4778901b53481a53119fcb1da110429 (diff)
downloadFreeBSD-src-43e7c1af8b2db7fbcfc5f57130190bc06d3eb7ae.zip
FreeBSD-src-43e7c1af8b2db7fbcfc5f57130190bc06d3eb7ae.tar.gz
* Compare pointer with NULL
* Remove trailing whitespace (added in r186162) * Reduce indentation by rephrasing test Submitted by: Christopher Mallon (christoph dot mallon at gmx dot de)
Diffstat (limited to 'sys/netinet6/nd6_rtr.c')
-rw-r--r--sys/netinet6/nd6_rtr.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c
index 588fb8c..7df364e 100644
--- a/sys/netinet6/nd6_rtr.c
+++ b/sys/netinet6/nd6_rtr.c
@@ -1331,16 +1331,15 @@ find_pfxlist_reachable_router(struct nd_prefix *pr)
struct llentry *ln;
int canreach;
- for (pfxrtr = LIST_FIRST(&pr->ndpr_advrtrs); pfxrtr;
+ for (pfxrtr = LIST_FIRST(&pr->ndpr_advrtrs); pfxrtr != NULL;
pfxrtr = LIST_NEXT(pfxrtr, pfr_entry)) {
IF_AFDATA_LOCK(pfxrtr->router->ifp);
ln = nd6_lookup(&pfxrtr->router->rtaddr, 0, pfxrtr->router->ifp);
IF_AFDATA_UNLOCK(pfxrtr->router->ifp);
- canreach = 0;
- if (ln != NULL) {
- canreach = ND6_IS_LLINFO_PROBREACH(ln);
- LLE_RUNLOCK(ln);
- }
+ if (ln == NULL)
+ continue;
+ canreach = ND6_IS_LLINFO_PROBREACH(ln);
+ LLE_RUNLOCK(ln);
if (canreach)
break;
}
OpenPOWER on IntegriCloud