FYI.  I just commited regress tests on regress/netinet/carp/ .
carp_4.sh demostrates the problem which the diff fixes.

On Tue, 18 Oct 2016 19:33:01 +0900 (JST)
YASUOKA Masahiko <[email protected]> wrote:
> 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.
> 
> ok?
> 
> 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 hlen)
>       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))) {
>               carpstats.carps_badif++;
>               CARP_LOG(LOG_INFO, sc,
> 

Reply via email to