Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tunnel_pkt_handler]: Skip nonexistent intfs #12424

Merged
merged 1 commit into from
Oct 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion dockers/docker-orchagent/tunnel_packet_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from sonic_py_common import logger as log

from pyroute2 import IPRoute
from pyroute2.netlink.exceptions import NetlinkError
from scapy.layers.inet import IP
from scapy.layers.inet6 import IPv6
from scapy.sendrecv import AsyncSniffer
Expand Down Expand Up @@ -115,7 +116,14 @@ def get_up_portchannels(self):
portchannel_intf_names = [name for name, _ in self.portchannel_intfs]
link_statuses = []
for intf in portchannel_intf_names:
status = self.netlink_api.link("get", ifname=intf)
try:
status = self.netlink_api.link("get", ifname=intf)
except NetlinkError:
# Continue if we find a non-existent interface since we don't
# need to listen on it while it's down/not created. Once it comes up,
# we will get another netlink message which will trigger this check again
logger.log_notice("Skipping non-existent interface {}".format(intf))
continue
link_statuses.append(status[0])
up_portchannels = []

Expand Down