* This routine is called to generate a message from the routing * socket indicating that a redirect has occurred, a routing lookup * has failed, or that a protocol has detected timeouts to a particular * destination. */
| 1769 | * destination. |
| 1770 | */ |
| 1771 | void |
| 1772 | rt_missmsg_fib(int type, struct rt_addrinfo *rtinfo, int flags, int error, |
| 1773 | int fibnum) |
| 1774 | { |
| 1775 | struct rt_msghdr *rtm; |
| 1776 | struct mbuf *m; |
| 1777 | struct sockaddr *sa = rtinfo->rti_info[RTAX_DST]; |
| 1778 | |
| 1779 | if (V_route_cb.any_count == 0) |
| 1780 | return; |
| 1781 | m = rtsock_msg_mbuf(type, rtinfo); |
| 1782 | if (m == NULL) |
| 1783 | return; |
| 1784 | |
| 1785 | if (fibnum != RT_ALL_FIBS) { |
| 1786 | KASSERT(fibnum >= 0 && fibnum < rt_numfibs, ("%s: fibnum out " |
| 1787 | "of range 0 <= %d < %d", __func__, fibnum, rt_numfibs)); |
| 1788 | M_SETFIB(m, fibnum); |
| 1789 | m->m_flags |= RTS_FILTER_FIB; |
| 1790 | } |
| 1791 | |
| 1792 | rtm = mtod(m, struct rt_msghdr *); |
| 1793 | rtm->rtm_flags = RTF_DONE | flags; |
| 1794 | rtm->rtm_errno = error; |
| 1795 | rtm->rtm_addrs = rtinfo->rti_addrs; |
| 1796 | rt_dispatch(m, sa ? sa->sa_family : AF_UNSPEC); |
| 1797 | } |
| 1798 | |
| 1799 | void |
| 1800 | rt_missmsg(int type, struct rt_addrinfo *rtinfo, int flags, int error) |
no test coverage detected