View Issue Details

IDProjectCategoryView StatusLast Update
0001039unrealircdpublic2003-11-20 19:43
Reportersyzop Assigned Tosyzop  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.2-beta17 
Summary0001039: IPv6 on freebsd: problem binding to ::ffff:x.x.x.x
DescriptionIt has been reported a few times so I'm making a bugreport of it.
If you compile with IPv6 support at freebsd and then try to bind to a ipv4 ip via ::ffff:1.2.3.4 alike (correct IP ofcoz) then it doesn't work: Can't assign requested address.
Additional InformationI've no freebsd experience at all, let alone ipv6+freebsd so I dunnow who's fault it is and don't even know how to test but I hate it nobody of those people created a bug report of it :P.
3rd party modules

Activities

aragon

2003-06-15 20:47

reporter   ~0002972

I can confirm this behaviour. The ircd binds fine to ipv6 sockets though.

syzop

2003-06-21 17:29

administrator   ~0003010

Ok I've now tested this and it just works fine.
My listen line is:
listen [::ffff:192.168.5.226]:6011;
no ircd.log errors and it connects just fine, this is the netstat -an output:
tcp46 0 0 *.6667 *.* LISTEN
(which is just a listen *:6667 thingy)
tcp4 0 0 192.168.5.226.6011 *.* LISTEN
(which is the one we are talking about)

root:/tmp/Unreal3.2/src# uname -a
FreeBSD syzfreebsd.hoklan 4.7-RELEASE FreeBSD 4.7-RELEASE #0: Wed Oct 9 15:08:34 GMT 2002 [email protected]:/usr/obj/usr/src/sys/GENERIC i386

AngryWolf

2003-06-21 19:21

reporter   ~0003013

Okay, same problem here,

[wolf@ip2 wolf]$ uname -a
FreeBSD ip2.mymachine.com 5.1-RC1 FreeBSD 5.1-RC1 #0: Wed Jun 11 07:25:31 CEST 2003 [email protected]:/usr/src/sys/i386/compile/MYKERNEL i386

(MYKERNEL, yeah, because I wanted the pcm module.)

[wolf@ip2 wolf]$ ifconfig dc0
dc0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 10.0.0.2 netmask 0xffffff00 broadcast 10.0.0.255
        inet6 fe80::204:e2ff:fe1d:85ab%dc0 prefixlen 64 scopeid 0x1
        ether 00:04:e2:1d:85:ab
        media: Ethernet autoselect (10baseT/UTP)
        status: active


I've tried to listen [::ffff:10.0.0.2]:6667 and my log says:

[Sat Jun 21 21:04:32 2003] - Error binding stream socket to IP ::ffff:10.0.0.2 port 6667 - irc.test.hu[]:Can't assign requested address

While [::1]:6667 works well, without problems:

[wolf@ip2 wolf]$ netstat -an | grep 6667 | grep LISTEN
tcp6 0 0 ::1.6667 *.* LISTEN

Any ideas?

syzop

2003-06-21 19:36

administrator   ~0003014

As you know I've almost 0 experience with freebsd (it's even running in vmware), but.. I've been googling a bit and I saw this:
-------/etc/rc.conf---------
    ipv6_ipv4mapping=""
        # Leave empty to disable IPv4 mapped IPv6 addr communication.
        # (like ::ffff:a.b.c.d). By default it's enabled.
----------------------------
I don't have such a line, but do you?
# grep ipv6 /etc/rc.conf
ipv6_enable="YES"

that's all I have :p.

aragon

2003-06-21 21:05

reporter   ~0003017

Hehe, egg on face! Syzop is correct. I can confirm 100% functionality with that option enabled on FreeBSD 5.0-RELEASE-p7.

As already pointed out add the following to /etc/rc.conf:

ipv6_ipv4mapping="YES" # default is NO from /etc/defaults/rc.conf

To enable the option without a reboot run the following as root:

sysctl -w net.inet6.ip6.v6only=0

Thank you Syzop!

syzop

2003-06-21 21:59

administrator   ~0003018

Ah, wow :p.

syzop

2003-06-22 00:25

administrator   ~0003020

I added a warning in .1840 if ::ffff:a.b.c.d-like addr's binding fails explaining that this could be caused by this *BSD setting.

Issue History

Date Modified Username Field Change
2003-06-15 20:42 syzop New Issue
2003-06-15 20:47 aragon Note Added: 0002972
2003-06-21 17:29 syzop Note Added: 0003010
2003-06-21 19:21 AngryWolf Note Added: 0003013
2003-06-21 19:36 syzop Note Added: 0003014
2003-06-21 21:05 aragon Note Added: 0003017
2003-06-21 21:59 syzop Note Added: 0003018
2003-06-22 00:25 syzop Status new => resolved
2003-06-22 00:25 syzop Resolution open => fixed
2003-06-22 00:25 syzop Assigned To => syzop
2003-06-22 00:25 syzop Note Added: 0003020
2003-11-20 19:43 syzop Status resolved => closed