| 618 | |
| 619 | #ifdef INET6 |
| 620 | void |
| 621 | in6_fillscopeid(struct sockaddr_in6 *sa6) |
| 622 | { |
| 623 | #if defined(__KAME__) |
| 624 | /* |
| 625 | * XXX: This is a special workaround for KAME kernels. |
| 626 | * sin6_scope_id field of SA should be set in the future. |
| 627 | */ |
| 628 | if (IN6_IS_ADDR_LINKLOCAL(&sa6->sin6_addr) || |
| 629 | IN6_IS_ADDR_MC_NODELOCAL(&sa6->sin6_addr) || |
| 630 | IN6_IS_ADDR_MC_LINKLOCAL(&sa6->sin6_addr)) { |
| 631 | if (sa6->sin6_scope_id == 0) |
| 632 | sa6->sin6_scope_id = |
| 633 | ntohs(*(u_int16_t *)&sa6->sin6_addr.s6_addr[2]); |
| 634 | sa6->sin6_addr.s6_addr[2] = sa6->sin6_addr.s6_addr[3] = 0; |
| 635 | } |
| 636 | #endif |
| 637 | } |
| 638 | |
| 639 | /* Mask to length table. To check an invalid value, (length + 1) is used. */ |
| 640 | static const u_char masktolen[256] = { |
no outgoing calls
no test coverage detected