Fix an incompatibility between CARP and IPv4 multicast routing, whereby

the VRRPv2 advertisements will originate from the wrong source address.
This only affects kernels compiled with MROUTING and after the MRT_INIT
ioctl() has been issued.
Set imo_multicast_vif in carp's softc to the invalid value -1 after it is
zeroed by softc allocation, to stop the ip_output() path looking up the
incorrect source address thinking a vif is set.

PR:		kern/100532
Submitted by:	Bohus Plucinsky
MFC after:	1 week
This commit is contained in:
Bruce M Simpson 2006-09-25 11:53:54 +00:00
parent b9ad4a7bf0
commit 13c8384424

View File

@ -379,6 +379,7 @@ carp_clone_create(struct if_clone *ifc, int unit, caddr_t params)
(sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_CARP,
M_WAITOK);
sc->sc_imo.imo_max_memberships = IP_MIN_MEMBERSHIPS;
sc->sc_imo.imo_multicast_vif = -1;
callout_init(&sc->sc_ad_tmo, NET_CALLOUT_MPSAFE);
callout_init(&sc->sc_md_tmo, NET_CALLOUT_MPSAFE);