* Send the packet up to the user daemon, or eventually do kernel encapsulation * */
| 2319 | * |
| 2320 | */ |
| 2321 | static int |
| 2322 | pim_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 |
no test coverage detected