summaryrefslogtreecommitdiff
path: root/lib/debug.c
diff options
context:
space:
mode:
authorFrancois Dumontet <francois.dumontet@6wind.com>2023-09-29 15:23:24 +0200
committerFrancois Dumontet <francois.dumontet@6wind.com>2023-11-08 21:20:17 +0100
commitfc3c9b177cdec2868941232427754f834e6be5f2 (patch)
treeaacdf18a66a32531707350ee0272e600d487facf /lib/debug.c
parentad44b541ef84adfdfb97460ea0de50371328675b (diff)
bgp: fix bgp4v2 MIB NLRI INDEX format and order
With a BGP configuration with ipv4 peering, and ipv6 peering, an snmpwalk is stopped while walking over the bgp4v2NlriTable snmpwalk -c TEST -v2c -On -Ln 1.1.1.2 .1.3.6.1.3.5.1.1.4 [...] .1.3.6.1.3.5.1.1.4.1.2.1.2.32.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1 = Gauge32: 13380 .1.3.6.1.3.5.1.1.9.1.1.1.1.1.1.1.0.24.0.0.0.0 = Gauge32: 0 .1.3.6.1.3.5.1.1.9.1.1.1.1.1.1.1.0.24.0.0.0.0 = Gauge32: 0 >= .1.3.6.1.3.5.1.1.9.1.1.1.1.1.1.1.0.24.0.0.0.0 The walk stopped because the index used in the NlriTable entries is decrementing, and this is against the snmp specifications. Also, the computed index is wrong, and does not match the provided draft-ietf-idr-bgp4-mibv2-1 specification. Fix this by computing a valid index, and by finding out the next consecutive prefix. The resulting changes do not break the walk, and the output is changed: root@dut-vm:~# snmpwalk -v 2c -c public -Ln -On localhost 1.3.6.1.3.5.1.1.9.1 .1.3.6.1.3.5.1.1.9.1.1.1.1.1.1.10.200.0.0.24.1.10.125.0.2.1 = Gauge32: 0 .1.3.6.1.3.5.1.1.9.1.1.1.1.1.1.10.244.0.0.24.1.10.125.0.2.1 = Gauge32: 0 .1.3.6.1.3.5.1.1.9.1.2.1.1.1.1.10.200.0.0.24.1.10.125.0.2.1 = INTEGER: 1 .1.3.6.1.3.5.1.1.9.1.2.1.1.1.1.10.244.0.0.24.1.10.125.0.2.1 = INTEGER: 1 .1.3.6.1.3.5.1.1.9.1.3.1.1.1.1.10.200.0.0.24.1.10.125.0.2.1 = INTEGER: 1 .1.3.6.1.3.5.1.1.9.1.3.1.1.1.1.10.244.0.0.24.1.10.125.0.2.1 = INTEGER: 1 .1.3.6.1.3.5.1.1.9.1.4.1.1.1.1.10.200.0.0.24.1.10.125.0.2.1 = INTEGER: 1 .1.3.6.1.3.5.1.1.9.1.4.1.1.1.1.10.244.0.0.24.1.10.125.0.2.1 = INTEGER: 1 .1.3.6.1.3.5.1.1.9.1.5.1.1.1.1.10.200.0.0.24.1.10.125.0.2.1 = Hex-STRING: 0A C8 00 00 .1.3.6.1.3.5.1.1.9.1.5.1.1.1.1.10.244.0.0.24.1.10.125.0.2.1 = Hex-STRING: 0A F4 00 00 Fixes: c681e937d7ae8904f748819fce37498ce0ea8f7d (bgpd: Implement SNMP BGP4V2-MIB (bgp4V2NlriTable), part 1) Fixes: 2ce69011c4199bead8172b5ee7e63485e2f861c8 (bgpd: Implement SNMP BGP4V2-MIB (bgp4V2NlriTable), part 2) Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
Diffstat (limited to 'lib/debug.c')
0 files changed, 0 insertions, 0 deletions