Skip to content

Commit a137697

Browse files
Set arp_accept to 2 by default (#4383)
* When grat_arp is not enabled in config_db for an interface, intfmgr automatically sets kernel sysctl arp_accept for that interface to 0 as well as sets the sysctl accept_untracked_na for that interface to 0. When grat_arp is enabled in config_db, intfmgr sets the kernel sysctl arp_accept for that interface to 1 and also sets the sysctl accept_untracked_na for 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_accept and accept_untracked_na to 2 when grat_arp is enabled in the config_db for any interface.
1 parent 13d6bd9 commit a137697

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cfgmgr/intfmgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ bool IntfMgr::setIntfGratArp(const string &alias, const string &grat_arp)
579579

580580
if (grat_arp == "enabled")
581581
{
582-
garp_enabled = "1";
582+
garp_enabled = "2";
583583
}
584584
else if (grat_arp == "disabled")
585585
{

tests/test_vlan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ def test_VlanHostIf(self, dvs):
507507
def test_VlanGratArp(self, dvs):
508508
def arp_accept_enabled():
509509
rc, res = dvs.runcmd("cat /proc/sys/net/ipv4/conf/Vlan{}/arp_accept".format(vlan))
510-
return (res.strip("\n") == "1", res)
510+
return (res.strip("\n") == "2", res)
511511

512512
def arp_accept_disabled():
513513
rc, res = dvs.runcmd("cat /proc/sys/net/ipv4/conf/Vlan{}/arp_accept".format(vlan))

0 commit comments

Comments
 (0)