Bug 262828 - [carp] CARP arp replays with wrong src mac
Summary: [carp] CARP arp replays with wrong src mac
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-26 13:08 UTC by Ivan Rozhuk
Modified: 2024-01-12 20:29 UTC (History)
6 users (show)

See Also:


Attachments
patch (1.65 KB, patch)
2022-03-26 13:08 UTC, Ivan Rozhuk
no flags Details | Diff
patch_broken (3.36 KB, patch)
2023-08-16 15:43 UTC, Ivan Rozhuk
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Ivan Rozhuk 2022-03-26 13:29:09 UTC
After patch apply:

13:02:41.140090 00:00:5e:00:01:01 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.1.3 tell 192.168.1.1, length 28
13:02:41.140170 00:00:5e:00:01:01 > a8:a1:59:0e:1f:b6, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Reply 192.168.1.1 is-at 00:00:5e:00:01:01, length 28
Comment 2 Daniel 2023-08-14 06:36:51 UTC
any eta on when this will be merged and
in which version this patch will be released?
Comment 3 Zhenlei Huang freebsd_committer freebsd_triage 2023-08-15 02:59:41 UTC
The patch looks good, and I'd suggest to add a sysctl knob to turn this feature on.
Comment 4 Daniel 2023-08-15 06:58:15 UTC
this would be great, is there any guide on how to implement
a sysctl or any other flag?

Or maybe Ivan Rozhuk has time to implement it?
Comment 5 Zhenlei Huang freebsd_committer freebsd_triage 2023-08-15 07:30:25 UTC
(In reply to Daniel from comment #4)

There's an example https://reviews.freebsd.org/D39866 .
Comment 6 Ivan Rozhuk 2023-08-16 00:25:12 UTC
I do not see usecases where it should be disabled by sysctl.
Comment 7 Zhenlei Huang freebsd_committer freebsd_triage 2023-08-16 02:46:55 UTC
(In reply to Ivan Rozhuk from comment #6)

As @Gleb Smirnoff Has pointed out:
> According to RFC826, which is current standard for ARP implementations,
> the hardware address in the transmission layer does not need to match
> the hardware addrees in the ARP reply packet itself. At least I can't
> find any evidence in the RFC that it must or even should. Moreover, it
> is mentioned in the RFC that:

> "Ethernet transmission layer (not necessarily accessible to the user)"

> So, RFC states that data in the Ethernet header isn't crucial for
> the operation of address resolution protocol.

This sysctl knob is for non-RFC-compliant devices and should be default off, so that the change will be a NOOP to existing (RFC-compliant) setups. 

The change is somewhat different than the original design of CARP protocol, until it is proven stable enough then let's change the sysctl knob to default on and eventually remove it.
Comment 8 Ivan Rozhuk 2023-08-16 12:11:02 UTC
This was answered in next message: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=141023#c5 :)

RFC/nonRFC compliant in irrelevant.
Patch fixes that broken in real world and does not broke anything.
Patch does not broke RFC.

I will add sysctl to control this.
Comment 9 Daniel 2023-08-16 12:23:01 UTC
(In reply to Ivan Rozhuk from comment #8)

thanks!
Comment 10 Ivan Rozhuk 2023-08-16 15:43:20 UTC
Created attachment 244151 [details]
patch_broken

Zhenlei Huang, this builds only if "device carp" is present in kernel config file.
I do not see any way how to keep knob in "net.inet.carp" and do not broke kernel build without "device carp".
Can you suggest way to add sysctl knob?
Comment 11 Zhenlei Huang freebsd_committer freebsd_triage 2023-08-23 04:32:24 UTC
(In reply to Ivan Rozhuk from comment #10)
> Zhenlei Huang, this builds only if "device carp" is present in kernel config file.
> I do not see any way how to keep knob in "net.inet.carp" and do not broke kernel
> build without "device carp".
> Can you suggest way to add sysctl knob?

I'll look at this when available.