* This function is similar to sa6_checkzone, but it uses given ifp * to initialize sin6_scope_id. */
| 580 | * to initialize sin6_scope_id. |
| 581 | */ |
| 582 | int |
| 583 | sa6_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 | } |
nothing calls this directly
no test coverage detected