* Mark an interface down and notify protocols of * the transition. */
| 2192 | * the transition. |
| 2193 | */ |
| 2194 | static void |
| 2195 | if_unroute(struct ifnet *ifp, int flag, int fam) |
| 2196 | { |
| 2197 | struct ifaddr *ifa; |
| 2198 | |
| 2199 | KASSERT(flag == IFF_UP, ("if_unroute: flag != IFF_UP")); |
| 2200 | |
| 2201 | ifp->if_flags &= ~flag; |
| 2202 | getmicrotime(&ifp->if_lastchange); |
| 2203 | CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) |
| 2204 | if (fam == PF_UNSPEC || (fam == ifa->ifa_addr->sa_family)) |
| 2205 | pfctlinput(PRC_IFDOWN, ifa->ifa_addr); |
| 2206 | ifp->if_qflush(ifp); |
| 2207 | |
| 2208 | if (ifp->if_carp) |
| 2209 | (*carp_linkstate_p)(ifp); |
| 2210 | rt_ifmsg(ifp); |
| 2211 | } |
| 2212 | |
| 2213 | /* |
| 2214 | * Mark an interface up and notify protocols of |
no test coverage detected