MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rt_dispatch

Function rt_dispatch

freebsd/net/rtsock.c:2064–2093  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2062}
2063
2064static void
2065rt_dispatch(struct mbuf *m, sa_family_t saf)
2066{
2067 struct m_tag *tag;
2068
2069 /*
2070 * Preserve the family from the sockaddr, if any, in an m_tag for
2071 * use when injecting the mbuf into the routing socket buffer from
2072 * the netisr.
2073 */
2074 if (saf != AF_UNSPEC) {
2075 tag = m_tag_get(PACKET_TAG_RTSOCKFAM, sizeof(unsigned short),
2076 M_NOWAIT);
2077 if (tag == NULL) {
2078 m_freem(m);
2079 return;
2080 }
2081 *(unsigned short *)(tag + 1) = saf;
2082 m_tag_prepend(m, tag);
2083 }
2084#ifdef VIMAGE
2085 if (V_loif)
2086 m->m_pkthdr.rcvif = V_loif;
2087 else {
2088 m_freem(m);
2089 return;
2090 }
2091#endif
2092 netisr_queue(NETISR_ROUTE, m); /* mbuf is free'd on failure. */
2093}
2094
2095/*
2096 * Checks if rte can be exported v.r.t jails/vnets.

Callers 8

send_rtm_replyFunction · 0.85
rt_missmsg_fibFunction · 0.85
rt_ifmsgFunction · 0.85
rtsock_addrmsgFunction · 0.85
rtsock_routemsg_infoFunction · 0.85
rt_newmaddrmsgFunction · 0.85
rt_ieee80211msgFunction · 0.85
rt_ifannouncemsgFunction · 0.85

Calls 4

netisr_queueFunction · 0.85
m_tag_getFunction · 0.50
m_freemFunction · 0.50
m_tag_prependFunction · 0.50

Tested by

no test coverage detected