From ccca90fcfa6f4eb82fee954bc064599907b67096 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 10 Feb 2016 17:44:00 +0100 Subject: vrrp: use the packet's incoming length to compute the checksum In VRRPv3, the packet's length used to compute the VRRP checksum is taken from the local configuration instead of the received packet. This means that the checksum may be reported as bad when the number of advertised addresses differ from the local setup evenhought the checksum is in fact good. Let's use the real packet's size instead. --- keepalived/vrrp/vrrp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keepalived/vrrp/vrrp.c b/keepalived/vrrp/vrrp.c index 31b7a75..877b631 100644 --- a/keepalived/vrrp/vrrp.c +++ b/keepalived/vrrp/vrrp.c @@ -455,7 +455,7 @@ vrrp_in_chk(vrrp_t * vrrp, char *buffer) ipv4_phdr.dst = htonl(INADDR_VRRP_GROUP); ipv4_phdr.zero = 0; ipv4_phdr.proto = IPPROTO_VRRP; - ipv4_phdr.len = htons(vrrp_hd_len(vrrp)); + ipv4_phdr.len = htons(vrrphdr_len - sizeof(vrrphdr_t)); in_csum((u_short *) &ipv4_phdr, sizeof(ipv4_phdr), 0, &acc_csum); if (in_csum((u_short *) hd, vrrphdr_len, acc_csum, NULL)) { -- 1.7.12.1