ip_mroute.c (e6b9152d20e900673ee0e9dc9f2bc540945d7832) ip_mroute.c (34333b16cdbff9a44599686b809052878716f44e)
1/*-
2 * Copyright (c) 1989 Stephen Deering
3 * Copyright (c) 1992, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Stephen Deering of Stanford University.
8 *

--- 1886 unchanged lines hidden (view full) ---

1895 m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
1896 }
1897
1898 /*
1899 * copy the old packet & pullup its IP header into the
1900 * new mbuf so we can modify it. Try to fill the new
1901 * mbuf since if we don't the ethernet driver will.
1902 */
1/*-
2 * Copyright (c) 1989 Stephen Deering
3 * Copyright (c) 1992, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Stephen Deering of Stanford University.
8 *

--- 1886 unchanged lines hidden (view full) ---

1895 m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
1896 }
1897
1898 /*
1899 * copy the old packet & pullup its IP header into the
1900 * new mbuf so we can modify it. Try to fill the new
1901 * mbuf since if we don't the ethernet driver will.
1902 */
1903 MGETHDR(mb_copy, M_DONTWAIT, MT_HEADER);
1903 MGETHDR(mb_copy, M_DONTWAIT, MT_DATA);
1904 if (mb_copy == NULL)
1905 return;
1906#ifdef MAC
1907 mac_create_mbuf_multicast_encap(m, vifp->v_ifp, mb_copy);
1908#endif
1909 mb_copy->m_data += max_linkhdr;
1910 mb_copy->m_len = sizeof(multicast_encap_iphdr);
1911

--- 798 unchanged lines hidden (view full) ---

2710 return; /* No pending upcalls */
2711
2712 bw_upcalls_n = 0;
2713
2714 /*
2715 * Allocate a new mbuf, initialize it with the header and
2716 * the payload for the pending calls.
2717 */
1904 if (mb_copy == NULL)
1905 return;
1906#ifdef MAC
1907 mac_create_mbuf_multicast_encap(m, vifp->v_ifp, mb_copy);
1908#endif
1909 mb_copy->m_data += max_linkhdr;
1910 mb_copy->m_len = sizeof(multicast_encap_iphdr);
1911

--- 798 unchanged lines hidden (view full) ---

2710 return; /* No pending upcalls */
2711
2712 bw_upcalls_n = 0;
2713
2714 /*
2715 * Allocate a new mbuf, initialize it with the header and
2716 * the payload for the pending calls.
2717 */
2718 MGETHDR(m, M_DONTWAIT, MT_HEADER);
2718 MGETHDR(m, M_DONTWAIT, MT_DATA);
2719 if (m == NULL) {
2720 log(LOG_WARNING, "bw_upcalls_send: cannot allocate mbuf\n");
2721 return;
2722 }
2723
2724 m->m_len = m->m_pkthdr.len = 0;
2725 m_copyback(m, 0, sizeof(struct igmpmsg), (caddr_t)&igmpmsg);
2726 m_copyback(m, sizeof(struct igmpmsg), len, (caddr_t)&bw_upcalls[0]);

--- 323 unchanged lines hidden (view full) ---

3050 struct igmpmsg *im;
3051 struct sockaddr_in k_igmpsrc = { sizeof k_igmpsrc, AF_INET };
3052
3053 VIF_LOCK_ASSERT();
3054
3055 /*
3056 * Add a new mbuf with an upcall header
3057 */
2719 if (m == NULL) {
2720 log(LOG_WARNING, "bw_upcalls_send: cannot allocate mbuf\n");
2721 return;
2722 }
2723
2724 m->m_len = m->m_pkthdr.len = 0;
2725 m_copyback(m, 0, sizeof(struct igmpmsg), (caddr_t)&igmpmsg);
2726 m_copyback(m, sizeof(struct igmpmsg), len, (caddr_t)&bw_upcalls[0]);

--- 323 unchanged lines hidden (view full) ---

3050 struct igmpmsg *im;
3051 struct sockaddr_in k_igmpsrc = { sizeof k_igmpsrc, AF_INET };
3052
3053 VIF_LOCK_ASSERT();
3054
3055 /*
3056 * Add a new mbuf with an upcall header
3057 */
3058 MGETHDR(mb_first, M_DONTWAIT, MT_HEADER);
3058 MGETHDR(mb_first, M_DONTWAIT, MT_DATA);
3059 if (mb_first == NULL) {
3060 m_freem(mb_copy);
3061 return ENOBUFS;
3062 }
3063 mb_first->m_data += max_linkhdr;
3064 mb_first->m_pkthdr.len = len + sizeof(struct igmpmsg);
3065 mb_first->m_len = sizeof(struct igmpmsg);
3066 mb_first->m_next = mb_copy;

--- 43 unchanged lines hidden (view full) ---

3110 if ((vifi >= numvifs) || (viftable[vifi].v_lcl_addr.s_addr == 0)) {
3111 m_freem(mb_copy);
3112 return EADDRNOTAVAIL; /* The iif vif is invalid */
3113 }
3114
3115 /*
3116 * Add a new mbuf with the encapsulating header
3117 */
3059 if (mb_first == NULL) {
3060 m_freem(mb_copy);
3061 return ENOBUFS;
3062 }
3063 mb_first->m_data += max_linkhdr;
3064 mb_first->m_pkthdr.len = len + sizeof(struct igmpmsg);
3065 mb_first->m_len = sizeof(struct igmpmsg);
3066 mb_first->m_next = mb_copy;

--- 43 unchanged lines hidden (view full) ---

3110 if ((vifi >= numvifs) || (viftable[vifi].v_lcl_addr.s_addr == 0)) {
3111 m_freem(mb_copy);
3112 return EADDRNOTAVAIL; /* The iif vif is invalid */
3113 }
3114
3115 /*
3116 * Add a new mbuf with the encapsulating header
3117 */
3118 MGETHDR(mb_first, M_DONTWAIT, MT_HEADER);
3118 MGETHDR(mb_first, M_DONTWAIT, MT_DATA);
3119 if (mb_first == NULL) {
3120 m_freem(mb_copy);
3121 return ENOBUFS;
3122 }
3123 mb_first->m_data += max_linkhdr;
3124 mb_first->m_len = sizeof(pim_encap_iphdr) + sizeof(pim_encap_pimhdr);
3125 mb_first->m_next = mb_copy;
3126

--- 343 unchanged lines hidden ---
3119 if (mb_first == NULL) {
3120 m_freem(mb_copy);
3121 return ENOBUFS;
3122 }
3123 mb_first->m_data += max_linkhdr;
3124 mb_first->m_len = sizeof(pim_encap_iphdr) + sizeof(pim_encap_pimhdr);
3125 mb_first->m_next = mb_copy;
3126

--- 343 unchanged lines hidden ---