Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/rpcbind/util.c
Show First 20 Lines • Show All 223 Lines • ▼ Show 20 Lines | if ((hint_sa->sa_family == AF_INET6) && | ||||
goto found; | goto found; | ||||
} | } | ||||
if (hint_sa->sa_family == AF_INET6) { | if (hint_sa->sa_family == AF_INET6) { | ||||
/* | /* | ||||
* For v6 link local addresses, if the caller is on | * For v6 link local addresses, if the caller is on | ||||
* a link-local address then use the scope id to see | * a link-local address then use the scope id to see | ||||
* which one. | * which one. | ||||
*/ | */ | ||||
if (IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(ifsa)) && | if (IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(ifsa))) { | ||||
IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(caller_sa)) && | if (IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(caller_sa)) && | ||||
IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(hint_sa))) { | IN6_IS_ADDR_LINKLOCAL(&SA2SIN6ADDR(hint_sa)) && | ||||
if (SA2SIN6(ifsa)->sin6_scope_id == | (SA2SIN6(ifsa)->sin6_scope_id == | ||||
SA2SIN6(caller_sa)->sin6_scope_id) { | SA2SIN6(caller_sa)->sin6_scope_id)) { | ||||
const int goodness = 3; | const int goodness = 3; | ||||
if (bestif_goodness < goodness) { | if (bestif_goodness < goodness) { | ||||
bestif = ifap; | bestif = ifap; | ||||
bestif_goodness = goodness; | bestif_goodness = goodness; | ||||
} | } | ||||
} else { | |||||
continue; | |||||
} | } | ||||
} | } | ||||
} | } | ||||
#endif /* INET6 */ | #endif /* INET6 */ | ||||
if (0 == bitmaskcmp(hint_sa, ifsa, ifmasksa)) { | if (0 == bitmaskcmp(hint_sa, ifsa, ifmasksa)) { | ||||
const int goodness = 2; | const int goodness = 2; | ||||
if (bestif_goodness < goodness) { | if (bestif_goodness < goodness) { | ||||
▲ Show 20 Lines • Show All 167 Lines • Show Last 20 Lines |