| 2422 | } |
| 2423 | |
| 2424 | int |
| 2425 | nd6_setdefaultiface(int ifindex) |
| 2426 | { |
| 2427 | int error = 0; |
| 2428 | |
| 2429 | if (ifindex < 0 || V_if_index < ifindex) |
| 2430 | return (EINVAL); |
| 2431 | if (ifindex != 0 && !ifnet_byindex(ifindex)) |
| 2432 | return (EINVAL); |
| 2433 | |
| 2434 | if (V_nd6_defifindex != ifindex) { |
| 2435 | V_nd6_defifindex = ifindex; |
| 2436 | if (V_nd6_defifindex > 0) |
| 2437 | V_nd6_defifp = ifnet_byindex(V_nd6_defifindex); |
| 2438 | else |
| 2439 | V_nd6_defifp = NULL; |
| 2440 | |
| 2441 | /* |
| 2442 | * Our current implementation assumes one-to-one maping between |
| 2443 | * interfaces and links, so it would be natural to use the |
| 2444 | * default interface as the default link. |
| 2445 | */ |
| 2446 | scope6_setdefault(V_nd6_defifp); |
| 2447 | } |
| 2448 | |
| 2449 | return (error); |
| 2450 | } |
| 2451 | |
| 2452 | bool |
| 2453 | nd6_defrouter_list_empty(void) |
no test coverage detected