summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_carp.c
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2006-07-08 00:01:01 +0000
committermlaier <mlaier@FreeBSD.org>2006-07-08 00:01:01 +0000
commitf7e47bf3740e1a9ed87106d518eafb689d1478b8 (patch)
tree5ab1a26547a4af85080e4f829286fde9f76075c5 /sys/netinet/ip_carp.c
parentcf1af765652056615e9133119e2c8c051fe90f27 (diff)
downloadFreeBSD-src-f7e47bf3740e1a9ed87106d518eafb689d1478b8.zip
FreeBSD-src-f7e47bf3740e1a9ed87106d518eafb689d1478b8.tar.gz
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
Diffstat (limited to 'sys/netinet/ip_carp.c')
-rw-r--r--sys/netinet/ip_carp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index a6de02b..1da5387 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);
}
OpenPOWER on IntegriCloud