]> git.ipfire.org Git - thirdparty/lldpd.git/commit
agent: fix SNMP walk on lldpRemTable when missing remote sysName fix/snmp-empty-sysname 393/head
authorVincent Bernat <vincent@bernat.ch>
Sat, 23 May 2020 12:32:39 +0000 (14:32 +0200)
committerVincent Bernat <vincent@bernat.ch>
Sat, 23 May 2020 12:38:57 +0000 (14:38 +0200)
commit351a4b1d149ac2d7445f3e7e7748dff345161817
treea4c9bf6c7bdd166050921a2f9a5a1822c4dd9e43
parenta170d31ef405ae160e21a91a73a347be66a691b1
agent: fix SNMP walk on lldpRemTable when missing remote sysName

When enumerating lldpRemSysName (and some others), one row could have
a NULL value because the remote system didn't provide a value. In this
case, we should return the next row.

There was already some code around that but it was not systematically
used. Therefore, we fix the issue for lldpRemTable and
lldpLocalSystemData. To ensure we catch future cases, we ensure
helpers functions use `default: return NULL` when no missing value is
allowed (no `break`, compiler would catch if it was the case) and
therefore, we don't need to try next OID and `default: break` when a
value may be missing and in this case, the caller should try next OID
upon receiving NULL.

Fix #392
NEWS
src/daemon/agent.c
tests/integration/conftest.py
tests/integration/data/connectx.pcap [new file with mode: 0644]
tests/integration/requirements.txt
tests/integration/test_pcap.py
tests/integration/test_snmp.py