aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Laier <mlaier@FreeBSD.org>2006-07-08 00:01:01 +0000
committerMax Laier <mlaier@FreeBSD.org>2006-07-08 00:01:01 +0000
commit05206588f20bba2f055822295e5423331a70d9c7 (patch)
tree5ab1a26547a4af85080e4f829286fde9f76075c5
parentb6352de96ca1b8d47ffeb4fc18f3324e00c565ed (diff)
downloadsrc-05206588f20bba2f055822295e5423331a70d9c7.tar.gz
src-05206588f20bba2f055822295e5423331a70d9c7.zip
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
Notes
Notes: svn path=/head/; revision=160164
-rw-r--r--sys/contrib/pf/net/if_pfsync.c5
-rw-r--r--sys/netinet/ip_carp.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/sys/contrib/pf/net/if_pfsync.c b/sys/contrib/pf/net/if_pfsync.c
index 8568b27ed4e7..1c0c6c35b879 100644
--- a/sys/contrib/pf/net/if_pfsync.c
+++ b/sys/contrib/pf/net/if_pfsync.c
@@ -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);
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index a6de02bfad62..1da53873c769 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -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);
}