Support 64bit BGP ASN
Closed this issue · 1 comments
davehope commented
When querying a BGPv4 enabled router using OSS_SNMP a negative number is returned if 64bit ASN are used. In the below example the correct AS number is 4242422222:
$ snmpwalk -c public -v 2c ip.address 1.3.6.1.2.1.15.2.0
iso.3.6.1.2.1.15.2.0 = INTEGER: -52545074
The fix seems to be subtracting the result from 4294967296 if the SNMP value is negative. i.e. 4294967296-52545074= 4242422222.
This issue is reproducible when using the bundled BGP sample:
https://github.com/opensolutions/OSS_SNMP/blob/master/examples/bgp.php
barryo commented
I'm afraid I don't have time to research SNMP support and official MIBs with rfc6793. If someone wants to do the leg work and post appropriate references here, I'll look at it.