* This routine is called to generate a message from the routing * socket indicating that the status of a network interface has changed. */
| 1808 | * socket indicating that the status of a network interface has changed. |
| 1809 | */ |
| 1810 | void |
| 1811 | rt_ifmsg(struct ifnet *ifp) |
| 1812 | { |
| 1813 | struct if_msghdr *ifm; |
| 1814 | struct mbuf *m; |
| 1815 | struct rt_addrinfo info; |
| 1816 | |
| 1817 | if (V_route_cb.any_count == 0) |
| 1818 | return; |
| 1819 | bzero((caddr_t)&info, sizeof(info)); |
| 1820 | m = rtsock_msg_mbuf(RTM_IFINFO, &info); |
| 1821 | if (m == NULL) |
| 1822 | return; |
| 1823 | ifm = mtod(m, struct if_msghdr *); |
| 1824 | ifm->ifm_index = ifp->if_index; |
| 1825 | ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; |
| 1826 | if_data_copy(ifp, &ifm->ifm_data); |
| 1827 | ifm->ifm_addrs = 0; |
| 1828 | rt_dispatch(m, AF_UNSPEC); |
| 1829 | } |
| 1830 | |
| 1831 | /* |
| 1832 | * Announce interface address arrival/withdraw. |
no test coverage detected