Make in-kernel multicast protocols for pfsync and carp work after enabling

dynamic resizing of multicast membership array.

Reported and testing by:	Maxim Konovalov, Scott Ullrich
Reminded by:			thompsa
MFC after:			2 weeks
This commit is contained in:
Max Laier
2006-07-08 00:01:01 +00:00
parent b6352de96c
commit 05206588f2
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -200,6 +200,7 @@ pfsync_clone_destroy(struct ifnet *ifp)
if_detach(ifp);
if_free(ifp);
LIST_REMOVE(sc, sc_next);
free(sc->sc_imo.imo_membership, M_PFSYNC);
free(sc, M_PFSYNC);
}
@@ -227,6 +228,10 @@ pfsync_clone_create(struct if_clone *ifc, int unit)
sc->sc_sendaddr.s_addr = htonl(INADDR_PFSYNC_GROUP);
sc->sc_ureq_received = 0;
sc->sc_ureq_sent = 0;
sc->sc_imo.imo_membership = (struct in_multi **)malloc(
(sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_PFSYNC,
M_WAITOK);
sc->sc_imo.imo_max_memberships = IP_MIN_MEMBERSHIPS;
ifp = SCP2IFP(sc);
if_initname(ifp, ifc->ifc_name, unit);
+5
View File
@@ -375,6 +375,10 @@ carp_clone_create(struct if_clone *ifc, int unit)
#ifdef INET6
sc->sc_im6o.im6o_multicast_hlim = CARP_DFLTTL;
#endif
sc->sc_imo.imo_membership = (struct in_multi **)malloc(
(sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_CARP,
M_WAITOK);
sc->sc_imo.imo_max_memberships = IP_MIN_MEMBERSHIPS;
callout_init(&sc->sc_ad_tmo, NET_CALLOUT_MPSAFE);
callout_init(&sc->sc_md_tmo, NET_CALLOUT_MPSAFE);
@@ -415,6 +419,7 @@ carp_clone_destroy(struct ifnet *ifp)
bpfdetach(ifp);
if_detach(ifp);
if_free_type(ifp, IFT_ETHER);
free(sc->sc_imo.imo_membership, M_CARP);
free(sc, M_CARP);
}