* Stores IPv6 address and prefix mask of @rt inside * @paddr and @pmask. Addresses are returned in de-embedded form. * Scopeid is set to 0 for non-LL addresses. */
| 364 | * Scopeid is set to 0 for non-LL addresses. |
| 365 | */ |
| 366 | void |
| 367 | rt_get_inet6_prefix_pmask(const struct rtentry *rt, struct in6_addr *paddr, |
| 368 | struct in6_addr *pmask, uint32_t *pscopeid) |
| 369 | { |
| 370 | const struct sockaddr_in6 *dst; |
| 371 | |
| 372 | dst = (const struct sockaddr_in6 *)rt_key_const(rt); |
| 373 | KASSERT((dst->sin6_family == AF_INET6), |
| 374 | ("rt family is %d, not inet", dst->sin6_family)); |
| 375 | if (IN6_IS_SCOPE_LINKLOCAL(&dst->sin6_addr)) |
| 376 | in6_splitscope(&dst->sin6_addr, paddr, pscopeid); |
| 377 | else |
| 378 | *paddr = dst->sin6_addr; |
| 379 | dst = (const struct sockaddr_in6 *)rt_mask_const(rt); |
| 380 | if (dst == NULL) |
| 381 | memset(pmask, 0xFF, sizeof(struct in6_addr)); |
| 382 | else |
| 383 | *pmask = dst->sin6_addr; |
| 384 | } |
| 385 | #endif |
| 386 | |
| 387 | static void |
no test coverage detected