View Issue Details

IDProjectCategoryView StatusLast Update
0003944unrealircdpublic2010-08-16 11:33
ReporterJobe1986Assigned Tosyzop 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86OSFreeBSDOS Version7.0
Product Version3.2.8 
Target VersionFixed in Version3.2.9-RC1 
Summary0003944: FreeBSD, IPv6 build, IPv4 listen blocks and *:port listen blocks
DescriptionOK, today I found a few issues with using UnrealIRCd 3.2.8.1 on FreeBSD 7.0 with IPv6 support enabled. Those issues are:
A) "listen *:6667;" only listens on IPv6 IP's (http://bugs.unrealircd.org/view.php?id=2741 suggests a solution that requires root which isnt an option for everyone)
B) A listen block specifying an IPv4 IP (both "1.2.3.4:6667" and "[::ffff:1.2.3.4]:6667" forms) fails with an error suggesting another solution, once again requiring root.

So having found a solution that does not require root, I have attached a .diff with a solution to BOTH issues.
TagsNo tags attached.
3rd party modules

Relationships

child of 0003776 resolvedsyzop Unreal3.2.9 TODO 

Activities

2010-08-15 20:02

 

unreal-ipv6-bsd.diff (458 bytes)

warg

2010-08-15 20:05

reporter   ~0016274

I like this ++

syzop

2010-08-15 21:09

administrator   ~0016275

This is already in latest CVS ;)

#if defined(INET6) && defined(IPV6_V6ONLY)
        /* We deal with both IPv4 and IPv6 in one (listen) socket.
         * This used to be on by default, but FreeBSD, and much later Linux
         * sometimes as well, seem to default it to IPv6 only ('1').
         * We now have this new fancy option to turn it off in Unreal,
         * instead of requiring our users to sysctl.
         */
        opt = 0;
        if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (OPT_TYPE *)&opt,
            sizeof(opt)) < 0)
                        report_error("setsockopt(IPV6_V6ONLY) %s:%s", cptr);
#endif

Anyway, I never got an opportunity to test it. But it works?

ohnobinki

2010-08-15 22:08

reporter   ~0016276

This code is already in CVS.

One note I'd like to make, however, is that on certain installations, setsockopt() _does_ return nonzero and spits a bunch of ``setsockopt(IPV6_V6ONLY)'' errors into ircd.log when it seems that there is no need to report such an error. (i.e., the setsockopt() call fails even though the IPv4 over IPv6 stuff is working find).

ohnobinki

2010-08-15 22:11

reporter   ~0016277

Ugh, I should'nt've touched this bug, I've only messed up its state :-/.

Jobe1986

2010-08-15 22:26

reporter   ~0016278

Last edited: 2010-08-15 22:27

Yes this does work on FreeBSD 7.0. But it is worth noting that this will not work on Windows due to Windows lack of dual stack support. So in case you haven't already (your paste didn't mention it) you should make sure this fix only applies to non-windows builds at the very least.

As for already being in CVS, I suppose I really should have checked first. :P

syzop

2010-08-16 11:33

administrator   ~0016282

Ok, glad to hear it actually works :)

Jobe: as for windows, we don't support IPv6 on windows, see 0000008

ohnobinki: good point, now got rid of any possible warning in CVS .868:
- Get rid of any setsockopt(IPV6_V6ONLY) errors in ircd.log (0003944).

Issue History

Date Modified Username Field Change
2010-08-15 20:02 Jobe1986 New Issue
2010-08-15 20:02 Jobe1986 File Added: unreal-ipv6-bsd.diff
2010-08-15 20:05 warg Note Added: 0016274
2010-08-15 21:09 syzop Note Added: 0016275
2010-08-15 22:08 ohnobinki QA => Not touched yet by developer
2010-08-15 22:08 ohnobinki U4: Need for upstream patch => No need for upstream InspIRCd patch
2010-08-15 22:08 ohnobinki Note Added: 0016276
2010-08-15 22:08 ohnobinki Status new => resolved
2010-08-15 22:08 ohnobinki Fixed in Version => 3.2.9-RC1
2010-08-15 22:08 ohnobinki Resolution open => fixed
2010-08-15 22:08 ohnobinki Assigned To => ohnobinki
2010-08-15 22:08 ohnobinki Relationship added child of 0003776
2010-08-15 22:09 ohnobinki Status resolved => assigned
2010-08-15 22:09 ohnobinki Assigned To ohnobinki => syzop
2010-08-15 22:11 ohnobinki Note Added: 0016277
2010-08-15 22:26 Jobe1986 Note Added: 0016278
2010-08-15 22:27 Jobe1986 Note Edited: 0016278
2010-08-16 11:33 syzop Note Added: 0016282
2010-08-16 11:33 syzop Status assigned => resolved