fix(operserv): match IPv6 address in OS FIND#20
Open
vjt wants to merge 1 commit into
Open
Conversation
OS FIND only compared the host wildcard against user->ip (the IPv4 long-int), so IPv6 users were never matched. ChanServ already does the v6 match in do_akick (chanserv.c:2371) via get_ip6(user->ipv6); apply the same against the OperServ FIND host disjunction so that masks like *@2a03:4000:2:33c:* find users connected on IPv6. The branch lives inside ENABLE_CAPAB_NICKIP because user->ipv6 only exists in that build path.
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.
Summary
OS FINDonly matched the host wildcard againstuser->ip(the IPv4 long-int), so v6 users were never returned. Live repro on the network:OS F *@2a03:4000:2:33c:*returnedEnd of search. Users found: 0.while users were clearly connected on that prefix.ChanServ already has the v6 branch in
do_akick(chanserv.c:2371) viaget_ip6(user->ipv6). This patch applies the same against the OperServ FIND host disjunction, so masks like*@2a03:4000:2:33c:*now match IPv6-connected users.The new branch lives inside
ENABLE_CAPAB_NICKIPbecauseuser->ipv6only exists in that build path (seeinc/users.h:63-66).Test plan
ENABLE_CAPAB_NICKIP(default)2a03:4000:2:33c::1OS F *@2a03:4000:2:33c:*returns the client (previously: 0 found)OS F *@<ipv4-mask>still matches v4 users (regression check)!(i.e.user@host) still parses