HomeFreeBSD

carp: deal with negative net.inet.carp.demotion

Description

carp: deal with negative net.inet.carp.demotion

Given nodes 1 and 2, where node 1 has an advskew of 0 and node 2 has an
advskew of 100, making them master and backup respectively.

If net.inet.carp.demotion is set to a negative value on node 1, node 2
might become master while node 1 still retains it master status. Wether
or not node 2 becomes master seems to depend on the nodes advskew and
what the demotion sysctl was set to on node 1.

The reason for node 2 becoming master seems to be that the calculated
advskew taking demotion into account is truncated to a single unsigned
byte when copied into the carp header for sending, and node 1 stays
master since it takes uses the whole non-truncated calculated advskew
when deciding wether to stay master.

PR: 259528
Reviewed by: donner, glebius
MFC after: 3 weeks
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D32759

(cherry picked from commit 1019354b54161c140d10a8203ff1e849c09c8010)

Details

Provenance
marius.h_lden.orgAuthored on Oct 31 2021, 8:18 PM
kpCommitted on Nov 22 2021, 1:55 AM
Reviewer
donner
Differential Revision
D32759: carp: deal with negative net.inet.carp.demotion
Parents
rG2107407b25ee: pf: Remove duplicate declaration of pf_ioctl_maxcount.
Branches
Unknown
Tags
Unknown