
194 Chapter 2—IPv6 Multicasting
Listing 2-70
ip6_mroute.c
1834 if ((mm->m_next = m_copy(m, 0, M_COPYALL)) == NULL) {
1835 m_freem(mm);
1836 return ENOBUFS;
1837 }
1838 i = MHLEN - M_LEADINGSPACE(mm);
1839 if (i > len)
1840 i = len;
1841 mm = m_pullup(mm, i);
1842 if (mm == NULL)
1843 return ENOBUFS;
1844 /* TODO: check it! */
1845 mm->m_pkthdr.len = len + sizeof(struct ip6_hdr);
ip6_mroute.c
1834–1845 m_copy() makes a complete copy of the original multicast packet. Unlike the
other upcall cases, a full copy is necessary because the packet will then be encapsulated
and forwarded by the routing daemon.
Listing 2-71
ip6_mroute.c
1847 /*
1848 * Send message to routing ...