MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rt_get_inet6_prefix_pmask

Function rt_get_inet6_prefix_pmask

freebsd/net/route/route_ctl.c:366–384  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

364 * Scopeid is set to 0 for non-LL addresses.
365 */
366void
367rt_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
387static void

Callers 2

export_rtaddrsFunction · 0.85
export_rtaddrsFunction · 0.85

Calls 2

in6_splitscopeFunction · 0.85
memsetFunction · 0.85

Tested by

no test coverage detected