Skip to content

Commit

Permalink
[ledd] prevent led crash on recirc port event (#232)
Browse files Browse the repository at this point in the history
Description
Prevent ledd crash when an event on recirc port happens

Motivation and Context
A recirculation port is not a physical interface tied to a xcvr
Calling the led change event on such a port could lead to a ledd crash

How Has This Been Tested?
This change was applied to running switch with its dependency #9471
Verified that ledd runs without crashing
  • Loading branch information
Staphylo authored Dec 17, 2021
1 parent e9ccd82 commit 7c363f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sonic-ledd/scripts/ledd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import sys

from sonic_py_common import daemon_base
from sonic_py_common import multi_asic
from sonic_py_common.interface import backplane_prefix, inband_prefix
from sonic_py_common.interface import backplane_prefix, inband_prefix, recirc_prefix
from swsscommon import swsscommon

#============================= Constants =============================
Expand Down Expand Up @@ -96,7 +96,7 @@ class DaemonLedd(daemon_base.DaemonBase):
fvp_dict = dict(fvp)

if op == "SET" and "oper_status" in fvp_dict:
if not key.startswith(backplane_prefix()) and not key.startswith(inband_prefix()):
if not key.startswith((backplane_prefix(), inband_prefix(), recirc_prefix())):
self.led_control.port_link_state_change(key, fvp_dict["oper_status"])
else:
return 4
Expand Down

0 comments on commit 7c363f5

Please sign in to comment.