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

Function sa6_checkzone_ifp

freebsd/netinet6/scope6.c:582–597  ·  view source on GitHub ↗

* This function is similar to sa6_checkzone, but it uses given ifp * to initialize sin6_scope_id. */

Source from the content-addressed store, hash-verified

580 * to initialize sin6_scope_id.
581 */
582int
583sa6_checkzone_ifp(struct ifnet *ifp, struct sockaddr_in6 *sa6)
584{
585 int scope;
586
587 scope = in6_addrscope(&sa6->sin6_addr);
588 if (scope == IPV6_ADDR_SCOPE_LINKLOCAL ||
589 scope == IPV6_ADDR_SCOPE_INTFACELOCAL) {
590 if (sa6->sin6_scope_id == 0) {
591 sa6->sin6_scope_id = in6_getscopezone(ifp, scope);
592 return (0);
593 } else if (sa6->sin6_scope_id != in6_getscopezone(ifp, scope))
594 return (EADDRNOTAVAIL);
595 }
596 return (sa6_checkzone(sa6));
597}

Callers

nothing calls this directly

Calls 3

in6_addrscopeFunction · 0.85
in6_getscopezoneFunction · 0.85
sa6_checkzoneFunction · 0.85

Tested by

no test coverage detected