Combine several checks in nd6_prefix_offlink() into one.

MFC after:	1 week
This commit is contained in:
Mark Johnston 2016-10-07 21:02:30 +00:00
parent 9a99954958
commit 7b0e84b7c8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=306826

View File

@ -1825,17 +1825,12 @@ nd6_prefix_offlink(struct nd_prefix *pr)
* interface.
*/
LIST_FOREACH(opr, &V_nd_prefix, ndpr_entry) {
if (opr == pr)
continue;
if ((opr->ndpr_stateflags & NDPRF_ONLINK) != 0)
continue;
/*
* KAME specific: detached prefixes should not be
* on-link.
*/
if ((opr->ndpr_stateflags & NDPRF_DETACHED) != 0)
if (opr == pr || (opr->ndpr_stateflags &
(NDPRF_ONLINK | NDPRF_DETACHED)) != 0)
continue;
if (opr->ndpr_plen == pr->ndpr_plen &&