SNMP: Improve parsing of OIDs containing IP addresses#2419
Open
rousskov wants to merge 1 commit into
Open
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.
rousskov
commented
May 11, 2026
| if ( size == sizeof(struct in_addr) ) | ||
| cp = (u_char *) &(i4addr.s_addr); | ||
| else | ||
| else if ( size == sizeof(struct in6_addr) ) |
Contributor
Author
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.
yadij
approved these changes
May 13, 2026
squid-anubis
pushed a commit
that referenced
this pull request
May 13, 2026
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.