[Bug 262828] [carp] CARP arp replays with wrong src mac

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 30 Sep 2024 22:35:58 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262828

--- Comment #16 from Ivan Rozhuk <rozhuk.im@gmail.com> ---
(In reply to Gleb Smirnoff from comment #14)

Topic with "hardware, that puts non-RFC compluant requirements on ARP packets"
started by zlei@.
IMHO it is irrelevant to this patch.



This patch fixes issues that at least was happen in our customers env and we
reproduce it in lab.

Annonce before patch apply:
root@safeinspect# tcpdump -n -i vmx2 -e -vvvvv arp | grep 192.168.15.224
tcpdump: listening on vmx2, link-type EN10MB (Ethernet), capture size 262144
bytes
11:57:51.249287 00:10:f3:2a:c2:ba > 00:00:5e:00:01:30, ethertype ARP (0x0806),
length 60: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.15.224 tell
192.168.14.1, length 46
11:57:51.249317 00:00:5e:00:01:30 > 00:10:f3:2a:c2:ba, ethertype ARP (0x0806),
length 42: Ethernet (len 6), IPv4 (len 4), Reply 192.168.15.224 is-at
00:00:5e:00:01:30, length 28
11:57:55.823376 00:00:5e:00:01:30 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806),
length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.15.225 tell
192.168.15.224, length 28
11:57:56.823714 00:00:5e:00:01:30 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806),
length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.15.225 tell
192.168.15.224, length 28
11:57:59.023621 00:00:5e:00:01:30 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806),
length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.15.225 tell
192.168.15.224, length 28
11:58:03.223640 00:00:5e:00:01:30 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806),
length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.15.225 tell
192.168.15.224, length 28
11:58:03.842451 00:00:5e:00:01:30 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806),
length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.15.225 tell
192.168.15.224, length 28
11:58:04.833800 00:00:5e:00:01:30 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806),
length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.15.225 tell
192.168.15.224, length 28
11:58:07.033641 00:00:5e:00:01:30 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806),
length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.15.225 tell
192.168.15.224, length 28
11:58:08.064321 00:0c:29:09:c3:44 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806),
length 60: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.15.224 tell
192.168.15.224, length 46
11:58:08.064352 00:00:5e:00:01:30 > 00:0c:29:09:c3:44, ethertype ARP (0x0806),
length 42: Ethernet (len 6), IPv4 (len 4), Reply 192.168.15.224 is-at
00:00:5e:00:01:30, length 28
11:58:11.233572 00:00:5e:00:01:30 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806),
length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.15.225 tell
192.168.15.224, length 28
11:58:11.234069 00:0c:29:09:c3:44 > 00:00:5e:00:01:30, ethertype ARP (0x0806),
length 60: Ethernet (len 6), IPv4 (len 4), Reply 192.168.15.224 is-at
00:0c:29:09:c3:44, length 46
11:58:11.852937 00:00:5e:00:01:30 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806),
length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.15.225 tell
192.168.15.224, length 28
11:58:11.853396 00:0c:29:09:c3:44 > 00:00:5e:00:01:30, ethertype ARP (0x0806),
length 60: Ethernet (len 6), IPv4 (len 4), Reply 192.168.15.224 is-at
00:0c:29:09:c3:44, length 46
11:58:12.289677 00:10:f3:2a:c2:ba > 00:00:5e:00:01:30, ethertype ARP (0x0806),
length 60: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.15.224 tell
192.168.14.1, length 46
11:58:12.289713 00:00:5e:00:01:30 > 00:10:f3:2a:c2:ba, ethertype ARP (0x0806),
length 42: Ethernet (len 6), IPv4 (len 4), Reply 192.168.15.224 is-at
00:00:5e:00:01:30, length 28
11:58:45.019891 00:10:f3:2a:c2:ba > 00:00:5e:00:01:30, ethertype ARP (0x0806),
length 60: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.15.224 tell
192.168.14.1, length 46
11:58:45.019926 00:00:5e:00:01:30 > 00:10:f3:2a:c2:ba, ethertype ARP (0x0806),
length 42: Ethernet (len 6), IPv4 (len 4), Reply 192.168.15.224 is-at
00:00:5e:00:01:30, length 28


Some master has owned CARPed 192.168.15.224.
Some backup CARPed host "00:0c:29:09:c3:44" is boot up and mess started at
"11:58:08.064321" and "11:58:11.234069" - "Gratuitous ARP" with wrong CARP MAC
in Ethernet and ARP headers.

Patch forces CARP MAC address to be used in Ethernet header and ARP header, not
depend on CARP state "master" or not.


We totally use 3 path to CARP:
https://github.com/rozhuk-im/freebsd/commit/b4fa20fcbfa7a707ef3d7e499e935764a9adc5f8
- this PR
https://github.com/rozhuk-im/freebsd/commit/4354cf4860dcf7e5e3c96d1fb0fdd95f1eabbfc3
- proper loopback detection
https://github.com/rozhuk-im/freebsd/commit/ddc90e5e6807469011f8aae93008ab50509813f7
- some simple cosmetic
and we have no CARP related error reports since these patches landed to
customers.



> And what about IPv6 NA announcements?

We do not use IPv6 so I do not dig into this. My guess is yes, IPv6 needs
similar changes.

-- 
You are receiving this mail because:
You are the assignee for the bug.