* Returns scope zone id for the unicast address @in6. * * Returns 0 for global unicast and loopback addresses. * Returns interface index for the link-local addresses. */
| 472 | * Returns interface index for the link-local addresses. |
| 473 | */ |
| 474 | uint32_t |
| 475 | in6_get_unicast_scopeid(const struct in6_addr *in6, const struct ifnet *ifp) |
| 476 | { |
| 477 | |
| 478 | if (IN6_IS_SCOPE_LINKLOCAL(in6)) |
| 479 | return (ifp->if_index); |
| 480 | return (0); |
| 481 | } |
| 482 | |
| 483 | void |
| 484 | in6_set_unicast_scopeid(struct in6_addr *in6, uint32_t scopeid) |