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

whois + host with IPv6 leads to info.host = '0' #90

Closed
ccoenen opened this issue Jun 11, 2012 · 3 comments

Comments

@ccoenen
Copy link
Contributor

commented Jun 11, 2012

when i send a whois for myself, i get back these arguments:

{ '0':
   {
     nick: 'cc',
     user: 'username',
     host: '0',
     realname: undefined,
     channels: ['#debug' ],
     server: '--redacted--',
     serverinfo: 'inspircd',
     idle: '1' 
  }
}

If i'm doing the same whois from my regular Chat-Client, my info looks like this:

Nick: cc (identified)
User: username@0::ffff:192.168.1.104
Server: --redacted-- (inspircd)
Im Moment in: #debug 
Idle for: 1 minute

apparently, our inspircd is ipv6-aware and maps all our ipv4-addresses into ipv6-space. This is standard-Behaviour for inspircd 1.2 (debian package default setup), so i guess it might come in handy as a general fix. Is there any other way to retrieve this info in the meantime (or as a permanent workaround)?

@ccoenen

This comment has been minimized.

Copy link
Contributor Author

commented Jun 11, 2012

Response taken from Wireshark:

:--redacted-- 311 nick cc username 0::ffff:192.168.1.92 * :purple

with

  • "--redacted--" being the Servername
  • 311 some IRC code?
  • nick (the nick from the user issuing the whois)
  • cc (the nick from the user in question)
  • username (the user's username)
  • 0::ffff:192.168.1.92 (ipv6/ipv4 address)
  • * (i have no idea)
  • :purple (the client is Pidgin, i believe this is why it's called purple)
@ccoenen

This comment has been minimized.

Copy link
Contributor Author

commented Jun 11, 2012

Here is, where it all goes wrong: The IPv6 IPs contain colons by default. parseMessage(), however, blindly splits at the first colon it comes across.
https://github.com/martynsmith/node-irc/blob/master/lib/irc.js#L784

@ericblade

This comment has been minimized.

Copy link

commented Jun 11, 2012

Until IPv6, it was probably against the spec to have any colons between the start of the line colon, and the message delimiting colon there. Not sure exactly how to best fix that, considering that all IRC messages basically use ":..data.. :message" format, and of course messages may contain anything, including ":". ":" is however an invalid character in servernames, nicknames, usernames, et al.

I guess regex'ing it or splitting it into individual words would work.

ccoenen added a commit to ccoenen/node-irc that referenced this issue Jun 12, 2012

This fixes the IPv6-Issue martynsmith#90 for me. I am not sure if it …
…breaks anything, though. My hubot still works fine.

martynsmith added a commit that referenced this issue Jun 28, 2012

Merge pull request #91 from ccoenen/patch-1
This fixes the IPv6-Issue #90 for me.

@ccoenen ccoenen closed this Jul 10, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.