Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve IPv6 support #917

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

ShadowNinja
Copy link

@ShadowNinja ShadowNinja commented Dec 31, 2016

IPv6 idents are now the first ten characters of the base32 encoded SHA-1 hash of the user's IP. Unlike IPv4 addresses, there is a possibility that there will be collisions (i.e., two IPs that get the same ident). This is unfourtunate, but it is unavoidable given that IRCds typically only allow about ten characters for the username. Fourtunately, the probability of collision is quite small (assuming SHA-1 produces well distributed output, the probability of even an 8-character ident collising is one in 32^8 or about one in a trillion).

This also fixes addresses starting with a colon (e.g., IPv4-mapped IPv6 addresses), unmaps IPv4-mapped IPv6 addresses, and fixes a spot where it was assumed that addresses with a dot were IPv4.

Note: I chose ten characters because a typical IRCd (Charybdis) limits the username to ten characters (or 9 characters if a tilde is added due to identd not being used).

IPv6 idents are now the first ten characters of the base32 encoded
SHA-1 hash of the user's IP.  Unlike IPv4 addresses, there is a
possibility that there will be collisions (i.e., two IPs that get the
same ident).  This is unfourtunate, but it is unavoidable given that
IRCds typically only allow about ten characters for the username.
Fourtunately, the probability of collision is quite small (assuming
SHA-1 produces well distributed output, the probability of even an
8-character ident collising is one in 32^8 or about one in a trillion).

This also fixes addresses starting with a colon (e.g., IPv4-mapped IPv6
addresses), unmaps IPv4-mapped IPv6 addresses, and fixes a place where
it was assumed that an address with a dot was IPv6.
@ShadowNinja ShadowNinja changed the title Add support for IPv6 idents and addresses starting with a colon Improve IPv6 support Dec 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant