* Look up a matching default router list entry and remove it. Returns true if a * matching entry was found, false otherwise. */
| 870 | * matching entry was found, false otherwise. |
| 871 | */ |
| 872 | bool |
| 873 | defrouter_remove(struct in6_addr *addr, struct ifnet *ifp) |
| 874 | { |
| 875 | struct nd_defrouter *dr; |
| 876 | |
| 877 | ND6_WLOCK(); |
| 878 | dr = defrouter_lookup_locked(addr, ifp); |
| 879 | if (dr == NULL) { |
| 880 | ND6_WUNLOCK(); |
| 881 | return (false); |
| 882 | } |
| 883 | |
| 884 | defrouter_unlink(dr, NULL); |
| 885 | ND6_WUNLOCK(); |
| 886 | defrouter_del(dr); |
| 887 | defrouter_rele(dr); |
| 888 | return (true); |
| 889 | } |
| 890 | |
| 891 | /* |
| 892 | * for default router selection |
no test coverage detected