svn commit: r306828 - head/sys/netinet6

Mark Johnston markj at FreeBSD.org
Fri Oct 7 21:03:20 UTC 2016


Author: markj
Date: Fri Oct  7 21:03:18 2016
New Revision: 306828
URL: https://svnweb.freebsd.org/changeset/base/306828

Log:
  Reduce the number of conditional statements in nd6_prefix_onlink().
  
  MFC after:	1 week

Modified:
  head/sys/netinet6/nd6_rtr.c

Modified: head/sys/netinet6/nd6_rtr.c
==============================================================================
--- head/sys/netinet6/nd6_rtr.c	Fri Oct  7 21:03:12 2016	(r306827)
+++ head/sys/netinet6/nd6_rtr.c	Fri Oct  7 21:03:18 2016	(r306828)
@@ -1734,11 +1734,11 @@ nd6_prefix_onlink(struct nd_prefix *pr)
 		/* XXX: freebsd does not have ifa_ifwithaf */
 		IF_ADDR_RLOCK(ifp);
 		TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
-			if (ifa->ifa_addr->sa_family == AF_INET6)
+			if (ifa->ifa_addr->sa_family == AF_INET6) {
+				ifa_ref(ifa);
 				break;
+			}
 		}
-		if (ifa != NULL)
-			ifa_ref(ifa);
 		IF_ADDR_RUNLOCK(ifp);
 		/* should we care about ia6_flags? */
 	}


More information about the svn-src-head mailing list