Skip to content

Commit 59f77ea

Browse files
[intfmgr]: Set proxy_arp kernel param (sonic-net#2334)
*[intfmgr]: Set proxy_arp kernel param Signed-off-by: Lawrence Lee <[email protected]>
1 parent 9da86f3 commit 59f77ea

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

cfgmgr/intfmgr.cpp

+10-4
Original file line numberDiff line numberDiff line change
@@ -566,23 +566,29 @@ bool IntfMgr::setIntfProxyArp(const string &alias, const string &proxy_arp)
566566
{
567567
stringstream cmd;
568568
string res;
569-
string proxy_arp_pvlan;
569+
string proxy_arp_status;
570570

571571
if (proxy_arp == "enabled")
572572
{
573-
proxy_arp_pvlan = "1";
573+
proxy_arp_status = "1";
574574
}
575575
else if (proxy_arp == "disabled")
576576
{
577-
proxy_arp_pvlan = "0";
577+
proxy_arp_status = "0";
578578
}
579579
else
580580
{
581581
SWSS_LOG_ERROR("Proxy ARP state is invalid: \"%s\"", proxy_arp.c_str());
582582
return false;
583583
}
584584

585-
cmd << ECHO_CMD << " " << proxy_arp_pvlan << " > /proc/sys/net/ipv4/conf/" << alias << "/proxy_arp_pvlan";
585+
cmd << ECHO_CMD << " " << proxy_arp_status << " > /proc/sys/net/ipv4/conf/" << alias << "/proxy_arp_pvlan";
586+
EXEC_WITH_ERROR_THROW(cmd.str(), res);
587+
588+
cmd.clear();
589+
cmd.str(std::string());
590+
591+
cmd << ECHO_CMD << " " << proxy_arp_status << " > /proc/sys/net/ipv4/conf/" << alias << "/proxy_arp";
586592
EXEC_WITH_ERROR_THROW(cmd.str(), res);
587593

588594
SWSS_LOG_INFO("Proxy ARP set to \"%s\" on interface \"%s\"", proxy_arp.c_str(), alias.c_str());

0 commit comments

Comments
 (0)