[201911] Avoid adding loopback interface (ip link add) when setting nat zone on loopback interface#1434
Merged
arlakshm merged 1 commit intosonic-net:201911from Sep 17, 2020
Conversation
…n loopback interface Signed-off-by: Akhilesh Samineni <[email protected]>
arlakshm
approved these changes
Sep 17, 2020
EdenGri
pushed a commit
to EdenGri/sonic-swss
that referenced
this pull request
Feb 28, 2022
#### What I did Refactor psuutil to use sonic-platform package in lieu of old, deprecated platform plugins. The psuutil utility is still useful, as psushow only reads and displays PSU data from State DB. However, this utility provides us the ability to read directly from the PSUs which is helpful for debugging. #### How I did it - Complete refactor to use sonic-platform package - Add more output columns to display (Model, Serial, Voltage, Current, Power) - Bump version to 2.0 - Add basic unit tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a clone for the PR #1411
Issue (#1311) :
Add Loopback interface to NAT zone 1
sudo config nat add interface Loopback0 -nat_zone 1
Seeing below error logs when NAT zone for Loopback changed to 1.
Apr 21 11:44:33.805637 cab18-3-dut INFO swss#supervisord: intfmgrd RTNETLINK answers: File exists
Apr 21 11:44:33.805637 cab18-3-dut ERR swss#intfmgrd: :- exec: /sbin/ip link add Loopback0 mtu 65536 type dummy && /sbin/ip link set Loopback0 up: Success
Apr 21 11:44:33.805637 cab18-3-dut ERR swss#intfmgrd: :- addLoopbackIntf: Command '/sbin/ip link add Loopback0 mtu 65536 type dummy && /sbin/ip link set Loopback0 up' failed with rc 512
Root cause for logs:
Whenever the ip address is assigned to Loopback1 using below command, "ip link" gets added for Loopback1 like shown below
config interface ip add Loopback1 20.20.20.20/32
82: Loopback1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/ether 86:68:3c:f4:25:b7 brd ff:ff:ff:ff:ff:ff
Then when setting the nat zone for the Loopback1 interface to 1, it tries to add "ip link" for Loopback1 again and leads to syslog errors.
Note : These syslog errors for Loopback will seen for all fields like vrf_name, mac_addr, admin_status, proxy_arp, errors are not specific to nat_zone field. Fields are https://github.com/Azure/sonic-swss/blob/master/cfgmgr/intfmgr.cpp#L383
Fix:
Added a set container to hold the Loopback string whenever loopback interface is created and using it to avoid the "addLoopbackIntf" call for the fields setting like nat_zone.
Signed-off-by: Akhilesh Samineni [email protected]