HomeFreeBSD

carp: isolate VRRP from CARP

Description

carp: isolate VRRP from CARP

There is only one functional change here - we don't allow SIOCSVH (or
netlink request) to change sc->sc_version. I'm convinced that allowing
such a change doesn't brings any practical value, but creates enless
minefields in front of both developers and end users (sysadmins). If
you want to switch from VRRP to CARP or vice versa, you'd need to recreate
the VHID.

Oh, one tiny funtional change: carp_ioctl_set() won't modify any fields
if it returns EINVAL. Previously you could provide valid advbase with
invalid advskew - that used to modify advbase and return EINVAL.

All other changes is a sweep around not ever using CARP fields when
we are in VRRP mode and vice versa. Also adding assertions on sc_version
where necessary.

Do not send VRRP vars in CARP mode via NetLink and vice versa. However
in compat ioctl SIOCGVH for VRRP mode the CARP fields would be zeroes.

This allows to declare softc as union and thus prevent any future logic
deterioration wrt to mixing VRRP and CARP.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D45039

Details

Provenance
glebiusAuthored on Apr 30 2024, 2:58 AM
kpCommitted on May 8 2024, 11:19 AM
Reviewer
kp
Differential Revision
D45039: carp: isolate VRRP from CARP
Parents
rG601438fbfa8e: carp: refactor packet tagging for ether_output()
Branches
Unknown
Tags
Unknown