Currenlty when carppeer + "real mac-address" are used at once,
changing MASTER by carpdemote causes "MASTER-MASTER" problem, BACKUP
is to become MASTER but the present MASTER also will keep its state.

The diff following will fix this problem.


Accept CARP advertisement packets whose destination is not for multicast.
When both "carppeer" and "real mac-address" are used at once and the
BACKUP is to take over the new MASTER, the present MASTER receives
such packets.

found by and diff from nagasaka at iij

diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 9eb5552..bfbf430 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -453,7 +453,7 @@ carp_proto_input_if(struct ifnet *ifp, struct mbuf *m, int 
        ismulti = IN_MULTICAST(ip->ip_dst.s_addr);
        /* check if received on a valid carp interface */
-       if (!((ifp->if_type == IFT_CARP && ismulti) ||
+       if (!(ifp->if_type == IFT_CARP ||
            (ifp->if_type != IFT_CARP && !ismulti && ifp->if_carp != NULL))) {
                CARP_LOG(LOG_INFO, sc,

Reply via email to