| 285 | } |
| 286 | |
| 287 | u_int32_t |
| 288 | scope6_addr2default(struct in6_addr *addr) |
| 289 | { |
| 290 | u_int32_t id; |
| 291 | |
| 292 | /* |
| 293 | * special case: The loopback address should be considered as |
| 294 | * link-local, but there's no ambiguity in the syntax. |
| 295 | */ |
| 296 | if (IN6_IS_ADDR_LOOPBACK(addr)) |
| 297 | return (0); |
| 298 | |
| 299 | /* |
| 300 | * XXX: 32-bit read is atomic on all our platforms, is it OK |
| 301 | * not to lock here? |
| 302 | */ |
| 303 | SCOPE6_LOCK(); |
| 304 | id = V_sid_default.s6id_list[in6_addrscope(addr)]; |
| 305 | SCOPE6_UNLOCK(); |
| 306 | return (id); |
| 307 | } |
| 308 | |
| 309 | /* |
| 310 | * Validate the specified scope zone ID in the sin6_scope_id field. If the ID |
no test coverage detected