Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/nd6.c
Show First 20 Lines • Show All 1,776 Lines • ▼ Show 20 Lines | case SIOCSPFXFLUSH_IN6: | ||||
struct in6_ifaddr *ia, *ia_next; | struct in6_ifaddr *ia, *ia_next; | ||||
struct nd_prefix *pr, *next; | struct nd_prefix *pr, *next; | ||||
struct nd_prhead prl; | struct nd_prhead prl; | ||||
LIST_INIT(&prl); | LIST_INIT(&prl); | ||||
ND6_WLOCK(); | ND6_WLOCK(); | ||||
LIST_FOREACH_SAFE(pr, &V_nd_prefix, ndpr_entry, next) { | LIST_FOREACH_SAFE(pr, &V_nd_prefix, ndpr_entry, next) { | ||||
if (IN6_IS_ADDR_LINKLOCAL(&pr->ndpr_prefix.sin6_addr)) | if (IN6_IS_ADDR_LINKLOCAL(&pr->ndpr_prefix.sin6_addr) | ||||
|| (pr->ndpr_num_autoconf_addrs != pr->ndpr_addrcnt)) | |||||
markj: Style, the `||` should be on the previous line.
So we don't purge any addresses if a non… | |||||
melifaroUnsubmitted Not Done Inline ActionsIn the other places, ndpr_num_autoconf_addrs was incremented/decremented w/o holding any lock. Maybe, doing per-prefix wlock on increment/decrement and checking the condition under wlock here as well could work. Also, a very dumb question: how does it help preventing panic? melifaro: In the other places, `ndpr_num_autoconf_addrs` was incremented/decremented w/o holding any lock. | |||||
continue; /* XXX */ | continue; /* XXX */ | ||||
nd6_prefix_unlink(pr, &prl); | nd6_prefix_unlink(pr, &prl); | ||||
} | } | ||||
ND6_WUNLOCK(); | ND6_WUNLOCK(); | ||||
while ((pr = LIST_FIRST(&prl)) != NULL) { | while ((pr = LIST_FIRST(&prl)) != NULL) { | ||||
LIST_REMOVE(pr, ndpr_entry); | LIST_REMOVE(pr, ndpr_entry); | ||||
/* XXXRW: in6_ifaddrhead locking. */ | /* XXXRW: in6_ifaddrhead locking. */ | ||||
▲ Show 20 Lines • Show All 884 Lines • Show Last 20 Lines |
Style, the || should be on the previous line.
So we don't purge any addresses if a non-autoconf address belongs to the prefix, but isn't that kind of surprising behaviour? I thought the main purpose of ndp -P is to flush all autoconfigured addresses.