Re: cannot get mac address value starting by "00" with an snmp module

2021-01-22 Thread dga via Net-snmp-coders
Hello Bill, Great ! You have found my bug ! My bad, I was  not aware of this difference between strncpy() and memcpy(. What's more I did not debuged it correctly ... I just add below the code to clarify the BUG and the FIX (may be other people have this bug in there module and did not see th

Re: cannot get mac address value starting by "00" with an snmp module

2021-01-21 Thread Bill Fenner
It's hard to say without seeing your code, but a common source of problems like this is using functions that are meant for nul-terminated strings (e.g., strncpy() ) instead of those meant for moving bytes around (e.g., memcpy() ). Bill On Fri, Jan 15, 2021 at 10:06 AM dga via Net-snmp-coders <

Re: cannot get mac address value starting by "00" with an snmp module

2021-01-15 Thread dga via Net-snmp-coders
Hello, I would like to add more details to clarify the problem. The 6 fields of mac address are returned to the agent under a string of 6 chars: (let's say mac[6]) So for the following mac address : "00:48:65:6C:6C:6F" : "00" => "NULL" = mac[0] "48" => "H" = mac[1] "65" => "e" = mac[2] "6

cannot get mac address value starting by "00" with an snmp module

2021-01-11 Thread dga via Net-snmp-coders
Hello, I have written an snmp module to include additional interfaces in the mib2 interface. However I face an issue with the field "ifPhysAddress" (mac address) if the mac address of the interface starts by "00" (example: "00:06:91:C6:B1:3F"). In that case I get "Hex-STRING: 00 00 00 00 00 0