diff --git a/dockers/docker-lldp-sv2/lldpmgrd b/dockers/docker-lldp-sv2/lldpmgrd index 7d2528a9d3a6..62ed6904fb13 100755 --- a/dockers/docker-lldp-sv2/lldpmgrd +++ b/dockers/docker-lldp-sv2/lldpmgrd @@ -74,11 +74,14 @@ def signal_handler(sig, frame): # ========================== Helpers ================================== def is_port_exist(port_name): - filename = "/sys/class/net/%s/ifindex" % port_name - if not os.path.exists(filename): - return False - - return True + filename = "/sys/class/net/%s/operstate" % port_name + if os.path.exists(filename): + with open(filename) as fp: + state = fp.read() + return "up" in state + else: + filename = "/sys/class/net/%s/ifindex" % port_name + return os.path.exists(filename) # ============================== Classes ==============================