SNMP: Improve parsing of OIDs containing IP addresses#2419
Conversation
Broken since 2007 commit cc192b5 made a false "4 or 16" assumption, possibly influenced by bad assumptions in earlier client_Inst() code. Also improved const-correctness to get fixed oid2addr() code to compile.
| if ( size == sizeof(struct in_addr) ) | ||
| cp = (u_char *) &(i4addr.s_addr); | ||
| else | ||
| else if ( size == sizeof(struct in6_addr) ) |
There was a problem hiding this comment.
It would be better to use i6addr variable instead of guessing its type inside sizeof(), but that would break symmetry with the above IPv4 code unless we introduce more out-of-scope polishing changes.
I also duplicated odd if line formatting to keep IPv4 and IPv6 code as similar as possible without introducing even more changes.
Broken since 2007 commit cc192b5 made a false "4 or 16" assumption, possibly influenced by bad assumptions in earlier client_Inst() code. Also improved const-correctness to get fixed oid2addr() code to compile.
|
@eduard-bagdasaryan, could you please check Anubis configuration? AFAICT, it was not updated when FreeBSD tests were removed in 8c76249, and Anubis is now waiting for the staging tests that will never run. |
I've updated the config. |
AFAICT, it did not help:
This request is best submitted at https://github.com/measurement-factory/anubis/issues but is it possible that this is already implemented? I see the following in the log that seems to contain the counters you are asking for: The "expected" 101 count matches the updated That is just my quick interpretation -- I did not check any details. @eduard-bagdasaryan, please correct me if I got it wrong. |
You seem to be right. |
After your adjustments, Anubis went further, but it ran into other problems. At this time, I think it is best to give Eduard a chance to check things out. |
Broken since 2007 commit cc192b5 made a false "4 or 16" assumption, possibly influenced by bad assumptions in earlier client_Inst() code. Also improved const-correctness to get fixed oid2addr() code to compile.
Broken since 2007 commit cc192b5 made a false "4 or 16" assumption,
possibly influenced by bad assumptions in earlier client_Inst() code.
Also improved const-correctness to get fixed oid2addr() code to compile.