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

Function pim_register_send

freebsd/netinet/ip_mroute.c:2321–2358  ·  view source on GitHub ↗

* Send the packet up to the user daemon, or eventually do kernel encapsulation * */

Source from the content-addressed store, hash-verified

2319 *
2320 */
2321static int
2322pim_register_send(struct ip *ip, struct vif *vifp, struct mbuf *m,
2323 struct mfc *rt)
2324{
2325 struct mbuf *mb_copy, *mm;
2326
2327 /*
2328 * Do not send IGMP_WHOLEPKT notifications to userland, if the
2329 * rendezvous point was unspecified, and we were told not to.
2330 */
2331 if (pim_squelch_wholepkt != 0 && (V_mrt_api_config & MRT_MFC_RP) &&
2332 in_nullhost(rt->mfc_rp))
2333 return 0;
2334
2335 mb_copy = pim_register_prepare(ip, m);
2336 if (mb_copy == NULL)
2337 return ENOBUFS;
2338
2339 /*
2340 * Send all the fragments. Note that the mbuf for each fragment
2341 * is freed by the sending machinery.
2342 */
2343 for (mm = mb_copy; mm; mm = mb_copy) {
2344 mb_copy = mm->m_nextpkt;
2345 mm->m_nextpkt = 0;
2346 mm = m_pullup(mm, sizeof(struct ip));
2347 if (mm != NULL) {
2348 ip = mtod(mm, struct ip *);
2349 if ((V_mrt_api_config & MRT_MFC_RP) && !in_nullhost(rt->mfc_rp)) {
2350 pim_register_send_rp(ip, vifp, mm, rt);
2351 } else {
2352 pim_register_send_upcall(ip, vifp, mm, rt);
2353 }
2354 }
2355 }
2356
2357 return 0;
2358}
2359
2360/*
2361 * Return a copy of the data packet that is ready for PIM Register

Callers 1

ip_mdqFunction · 0.85

Calls 4

pim_register_prepareFunction · 0.85
m_pullupFunction · 0.85
pim_register_send_rpFunction · 0.85
pim_register_send_upcallFunction · 0.85

Tested by

no test coverage detected