Created attachment 197828 [details]
use temporary copy for if_name
netsnmp_arch_interface_container_load() writes terminating NUL directly to the sdl_data *past* the length specified in sdl_nlen, overwriting first byte of physadrr.
This should probably be submitted to the upstream developers for net-snmp so that the patches can be included in the source.
I'm happy to apply these after they have accepted them.
yuri already submitted this upstream:
net-snmp released 5.8 in August this year, after 4(?) years since 5.7.3.
So a new release does not look likely.
I'm not sure what the net-snmp release schedule has to do with upstream accepting the patch, but, as previously stated, I'll get it committed once they do.
yuri, can you test if the problem still persists with net-snmp-5.8 ?
There's a patch in
I checked the 5.8 code, the problem is still there.
I checked just to be sure, 1-4 are igb, of which 1,3,4 has physaddr starting with 0 themselves, but igb1 physaddr was set to 'aa:bb:cc:dd:ee:ff' using ifconfig.
$ snmpwalk -v 2c -c public localhost IF-MIB::ifTable.1.6
IF-MIB::ifPhysAddress.1 = STRING: 0:25:90:85:4e:98
IF-MIB::ifPhysAddress.2 = STRING: 0:bb:cc:dd:ee:ff
IF-MIB::ifPhysAddress.3 = STRING: 0:25:90:85:4e:9a
IF-MIB::ifPhysAddress.4 = STRING: 0:25:90:85:4e:9b
IF-MIB::ifPhysAddress.5 = STRING:
Created attachment 207928 [details]
This patch is updated to work in 5.8. It's already in upstream, but not in 5.8.
Ups, it's not in upstream.
A commit references this bug:
Date: Sun Sep 29 19:41:49 UTC 2019
New revision: 513264
net-mgmt/net-snmp: fix for first byte of IF-MIB::ifPhysAddress is always 0
- netsnmp_arch_interface_container_load() writes terminating NUL
directly to the sdl_data *past* the length specified in sdl_nlen,
overwriting first byte of physadrr.
Submitted by: Yuri Pankov <firstname.lastname@example.org>
Reviewed by: Bart Van Assche <email@example.com> (upstream maintainer)
Approved by: zi (maintainer)
Obtained from: https://sourceforge.net/p/net-snmp/code/merge-requests/20/
Committed as merged by upstream, thanks!