I’m having a weird problem with irssi and IPv6. The long and the short of it is that irssi is trying to connect to an IRC server on the Internet with a source IP address of ::1, which is incorrect, as ::1 is the loopback address.
My server, glenstorm, is the IPv6 router, which contains the ppp0 interface that connects it to the IPv6 Internet. I am also running irssi on the same machine. It’s a router, so /proc/sys/net/ipv6/conf/all/forwarding is 1.
So, basically, when I fire up irssi, and type “/connect irc.ipv6.freenode.net“, it hangs when connecting. And for good reason: here’s the (edited for clarity) tcpdump output:
IP6 ::1.34823 > 2001:19f0:feee::dead:beef:cafe.6667 IP6 ::1.34823 > 2001:19f0:feee::dead:beef:cafe.6667 IP6 ::1.34823 > 2001:19f0:feee::dead:beef:cafe.6667
So obviously that’s wrong. And in violation of RFC 4291, I might add (“The loopback address must not be used as the source address in IPv6 packets that are sent outside of a single node.”).
I can hack around it by typing “/connect -host 2001:44b8:7df3:b970::14 irc.ipv6.freenode.net” into irssi, which forces it to use the source IP that I specified. But that’s just a hack — I’d like to get to the bottom of what actually causes it.
Update: Finally solved this. It’s because in my irssi config, I had the following directive:
core = {
real_name = "Jeremy Visser";
user_name = "jeremy";
nick = "jayvee_zzZZ";
resolve_prefer_ipv6 = "yes";
host = "glenstorm";
};
It was being told to use “glenstorm” as the “host”, which translates to “resolve the IP address of glenstorm and use that as the source IP address” (I think I misunderstood the meaning of the directive when I put that configuration flag in).
Of course, in /etc/hosts, I had the following entry:
::1 glenstorm
So, naturally, irssi decided to use ::1 as the source IP address. So removing the “host” line from the irssi config fixed the problem. While I’m sure that because of the aforementioned RFC, that shouldn’t have resulted in the subsequent symptoms, at the end of the day, it was simply Unix allowing me to shoot myself in the foot.


