Set arp_accept to 2 by default#4383
Conversation
* Creates a neighbor only if the source IP of the gratuitous ARP message is in the same subnet as an IP address configured on the receiving interface Signed-off-by: Prabhat Aravind <paravind@microsoft.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR updates SONiC’s interface gratuitous-ARP handling to program Linux arp_accept=2 when grat_arp is enabled, aligning ARP learning behavior with “same-subnet only” neighbor creation for GARP sources.
Changes:
- Change
cfgmgrinterface GARP programming to set/proc/sys/net/ipv4/conf/<if>/arp_acceptto2when enabled. - Update the VLAN integration test to expect
arp_accept=2whengrat_arpis enabled.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
cfgmgr/intfmgr.cpp |
Programs arp_accept with the new enabled value (2) when grat_arp is enabled. |
tests/test_vlan.py |
Adjusts the VLAN GARP sysctl assertion to expect arp_accept=2. |
|
@prabhataravind , can you link the sonic-mgmt test and update description with ADO number? |
|
@prabhataravind , for ipv6, do you know if this setting impact entries like 'fe80' -> linklocal. IMO, its probably safe to address ipv4 first and then ipv6 as separate PR. is 'grat_arp' value applicable for ipv4 as well? Can you also update the description with |
@prsunny accept_untracked_na only affects unsolicited/untracked NAs. Normal NDP (solicited NAs for fe80:: resolution) is unaffected. I have a test that ensures that link local ipv6 neighbor learning is unaffected. |
What I did
Microsoft ADO: 37292328
When
grat_arpis not enabled in config_db for an interface, intfmgr automatically sets kernel sysctlarp_acceptfor that interface to 0 as well as sets the sysctlaccept_untracked_nafor that interface to 0.When
grat_arpis enabled in config_db, intfmgr sets the kernel sysctlarp_acceptfor that interface to 1 and also sets the sysctlaccept_untracked_nafor that interface to 1.Starting kernel 5.19, this sysctl has been extended to take a value of 2 to restrict learning of neighbor IPs from GARPs or unsolicited NAs to only IPs that are in the same subnet as the IP configured on that interface. In SONiC, it is more meaningful to have the value 2 instead of 1 by default.
This patch changes the default value of
arp_acceptandaccept_untracked_nato 2 whengrat_arpis enabled in the config_db for any interface.Related sonic-mgmt change: sonic-net/sonic-mgmt#23320
Why I did it
How I verified it
Details if related