Skip to content

Commit

Permalink
[LLDP]: Modify OID index of LLDPRemTableUpdater MIB (sonic-net#155)
Browse files Browse the repository at this point in the history
* [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.
  • Loading branch information
SuvarnaMeenakshi committed Aug 3, 2020
1 parent d5f2b92 commit b5815d9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/sonic_ax_impl/mibs/ieee802_1ab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b5815d9

Please sign in to comment.