From 61a8b6837ca6edcdd6f0cb5ce7d8c1fcbbb78ae2 Mon Sep 17 00:00:00 2001 From: SuvarnaMeenakshi <50386592+SuvarnaMeenakshi@users.noreply.github.com> Date: Mon, 3 Aug 2020 11:17:37 -0700 Subject: [PATCH] [LLDP]: Modify OID index of LLDPRemTableUpdater MIB (#155) * [LLDP]: LLDPRemTableUpdater index in OID is a tuple of (if index, remote time mark, remote device index). In case of multi-asic platform, when querying this MIB it can happen that same if index result is seen in SNMP walk, with a different remote time mark. To avoid showing same if index result in the result, set remote time mark to 0. * Add code comment. --- src/sonic_ax_impl/mibs/ieee802_1ab.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sonic_ax_impl/mibs/ieee802_1ab.py b/src/sonic_ax_impl/mibs/ieee802_1ab.py index 7f2e134db..aaa24b954 100644 --- a/src/sonic_ax_impl/mibs/ieee802_1ab.py +++ b/src/sonic_ax_impl/mibs/ieee802_1ab.py @@ -430,7 +430,12 @@ def update_data(self): if not lldp_kvs: continue try: - time_mark = int(lldp_kvs[b'lldp_rem_time_mark']) + # OID index for this MIB consists of remote time mark, if_oid, remote_index. + # For multi-asic platform, it can happen that same interface index result + # is seen in SNMP walk, with a different remote time mark. + # To avoid repeating the data of same interface index with different remote + # time mark, remote time mark is made as 0 in the OID indexing. + time_mark = 0 remote_index = int(lldp_kvs[b'lldp_rem_index']) self.if_range.append((time_mark, if_oid,