diff options
author | obrien <obrien@FreeBSD.org> | 2005-09-07 10:11:49 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2005-09-07 10:11:49 +0000 |
commit | c532dfe7456f7cfd69cc1875646ebbafd781ae5c (patch) | |
tree | a65b15f9016e79eeea392bd977253f6b4fb46d5e /sys/netinet6/ip6_mroute.c | |
parent | b888392910bbf46a7bf35f9715822cfd277e96a9 (diff) | |
download | FreeBSD-src-c532dfe7456f7cfd69cc1875646ebbafd781ae5c.zip FreeBSD-src-c532dfe7456f7cfd69cc1875646ebbafd781ae5c.tar.gz |
IPv6 was improperly defining its malloc type the same as IPv4 (M_IPMADDR,
M_IPMOPTS, M_MRTABLE). Thus we had conflicting instantiations.
Create an IPv6-specific type to overcome this.
Diffstat (limited to 'sys/netinet6/ip6_mroute.c')
-rw-r--r-- | sys/netinet6/ip6_mroute.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 7a87d8d..e51f08f 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -118,7 +118,7 @@ #include <net/net_osdep.h> -static MALLOC_DEFINE(M_MRTABLE, "mf6c", "multicast forwarding cache entry"); +static MALLOC_DEFINE(M_MRTABLE6, "mf6c", "multicast forwarding cache entry"); #define M_HASCL(m) ((m)->m_flags & M_EXT) @@ -538,12 +538,12 @@ ip6_mrouter_done() struct rtdetq *n = rte->next; m_free(rte->m); - free(rte, M_MRTABLE); + free(rte, M_MRTABLE6); rte = n; } frt = rt; rt = rt->mf6c_next; - free(frt, M_MRTABLE); + free(frt, M_MRTABLE6); } } @@ -780,7 +780,7 @@ add_m6fc(mfccp) #ifdef UPCALL_TIMING collate(&(rte->t)); #endif /* UPCALL_TIMING */ - free(rte, M_MRTABLE); + free(rte, M_MRTABLE6); rte = n; } rt->mf6c_stall = NULL; @@ -824,7 +824,7 @@ add_m6fc(mfccp) } if (rt == NULL) { /* no upcall, so make a new entry */ - rt = (struct mf6c *)malloc(sizeof(*rt), M_MRTABLE, + rt = (struct mf6c *)malloc(sizeof(*rt), M_MRTABLE6, M_NOWAIT); if (rt == NULL) { splx(s); @@ -923,7 +923,7 @@ del_m6fc(mfccp) } *nptr = rt->mf6c_next; - free(rt, M_MRTABLE); + free(rt, M_MRTABLE6); splx(s); @@ -1048,7 +1048,7 @@ ip6_mforward(ip6, ifp, m) * Allocate mbufs early so that we don't do extra work if we * are just going to fail anyway. */ - rte = (struct rtdetq *)malloc(sizeof(*rte), M_MRTABLE, + rte = (struct rtdetq *)malloc(sizeof(*rte), M_MRTABLE6, M_NOWAIT); if (rte == NULL) { splx(s); @@ -1063,7 +1063,7 @@ ip6_mforward(ip6, ifp, m) (M_HASCL(mb0) || mb0->m_len < sizeof(struct ip6_hdr))) mb0 = m_pullup(mb0, sizeof(struct ip6_hdr)); if (mb0 == NULL) { - free(rte, M_MRTABLE); + free(rte, M_MRTABLE6); splx(s); return (ENOBUFS); } @@ -1086,10 +1086,10 @@ ip6_mforward(ip6, ifp, m) #endif /* no upcall, so make a new entry */ - rt = (struct mf6c *)malloc(sizeof(*rt), M_MRTABLE, + rt = (struct mf6c *)malloc(sizeof(*rt), M_MRTABLE6, M_NOWAIT); if (rt == NULL) { - free(rte, M_MRTABLE); + free(rte, M_MRTABLE6); m_freem(mb0); splx(s); return (ENOBUFS); @@ -1101,9 +1101,9 @@ ip6_mforward(ip6, ifp, m) mm = m_copy(mb0, 0, sizeof(struct ip6_hdr)); if (mm == NULL) { - free(rte, M_MRTABLE); + free(rte, M_MRTABLE6); m_freem(mb0); - free(rt, M_MRTABLE); + free(rt, M_MRTABLE6); splx(s); return (ENOBUFS); } @@ -1131,9 +1131,9 @@ ip6_mforward(ip6, ifp, m) im->im6_mbz = 0; break; default: - free(rte, M_MRTABLE); + free(rte, M_MRTABLE6); m_freem(mb0); - free(rt, M_MRTABLE); + free(rt, M_MRTABLE6); splx(s); return (EINVAL); } @@ -1164,9 +1164,9 @@ ip6_mforward(ip6, ifp, m) log(LOG_WARNING, "ip6_mforward: ip6_mrouter " "socket queue full\n"); mrt6stat.mrt6s_upq_sockfull++; - free(rte, M_MRTABLE); + free(rte, M_MRTABLE6); m_freem(mb0); - free(rt, M_MRTABLE); + free(rt, M_MRTABLE6); splx(s); return (ENOBUFS); } @@ -1198,7 +1198,7 @@ ip6_mforward(ip6, ifp, m) for (p = &rt->mf6c_stall; *p != NULL; p = &(*p)->next) if (++npkts > MAX_UPQ6) { mrt6stat.mrt6s_upq_ovflw++; - free(rte, M_MRTABLE); + free(rte, M_MRTABLE6); m_freem(mb0); splx(s); return (0); @@ -1262,14 +1262,14 @@ expire_upcalls(unused) do { struct rtdetq *n = rte->next; m_freem(rte->m); - free(rte, M_MRTABLE); + free(rte, M_MRTABLE6); rte = n; } while (rte != NULL); mrt6stat.mrt6s_cache_cleanups++; n6expire[i]--; *nptr = mfc->mf6c_next; - free(mfc, M_MRTABLE); + free(mfc, M_MRTABLE6); } else { nptr = &mfc->mf6c_next; } |