carp: define CARP_AUTHLEN for carp_authlen field

Replace the bare 7 with a named constant.
This commit is contained in:
Christos Longros authored and Gleb Smirnoff committed 2026-04-17 11:32:01 -07:00
1 parent 9a4a9f623b
commit d9e7dd4a19
2 files changed
+7 -1

No files matched your search

+1 -1
View File
@@ -1216,7 +1216,7 @@ carp_send_ad_locked(struct carp_softc *sc)
ch.carp_vhid = sc->sc_vhid;
ch.carp_advbase = sc->sc_advbase;
ch.carp_advskew = advskew;
ch.carp_authlen = 7; /* XXX DEFINE */
ch.carp_authlen = CARP_AUTHLEN;
ch.carp_pad1 = 0; /* must be zero */
ch.carp_cksum = 0;
+6
View File
@@ -80,6 +80,12 @@ struct carp_header {
CTASSERT(sizeof(struct carp_header) == 36);
/*
* CARP authentication length in 32-bit chunks:
* counter[2] (8 bytes) + SHA1 HMAC (20 bytes) = 28 bytes = 7 chunks.
*/
#define CARP_AUTHLEN 7
/*
* The VRRPv3 header layout is as follows:
* See RFC9568, 5.1. VRRP Packet Format