http://qs321.pair.com?node_id=973650

Rhandom has asked for the wisdom of the Perl Monks concerning the following question:

Net::Server is finally getting releases again after a lot of backlogged work. Among other new features, it now has fully configurable IPv6 support. If you pass it an IPv4 address, you'll get an IPv4 socket. If you pass it an IPv6 address, you'll get an IPv6 socket. At the moment, if you pass a hostname the server defaults to IPv4 - but you can configure it to do just IPv6 by passing ipv => 6 (or ipv => "IPv6"), or you can have it look for any available interfaces on either IPv4 or IPv6 by passing ipv => "*", and if you wanted to force both you could pass ipv => "46" (or ipv => "IPv4 IPv6". A similar issue exists for the "*" host (0.0.0.0 under IPv4 and :: under IPv6).

So at the moment, the default for the ipv parameter is 4. Should it be? Or should the default be "*".

Using IPv6 as the default is certainly nice if that is what you want. However, it does bring along some problems. It is additional chaining and resources; If you do find interfaces for both then you need to create multiple sockets (well :: on linux listens for both IPv6 and IPv4 by default - so only one socket is needed there); there is a bit of legacy security issue involved in that servers running off of hostnames, that previously weren't listening to IPv6 sockets, now would automatically begin listening; additionally existing allow_deny rules may not handle the new peeraddr formats coming in; and finally, any legacy socket specific code might break (hopefully there isn't too much of this).

One more item, the unofficial 0.99.6.1 package essentially had ipv => "*" as the default for 9 months, so that is certainly something in favor of "*".

So what do the monks think the default should be? It is likely that "*" is the way to go along with careful documentation saying to add ipv => 4 to your configurations if you don't want to begin binding IPv6 after your upgrade.

Thanks for any input.

<strikethrough> Update: So, based on comments, I am deciding to leave the default as is (IPv4) - however, to try and make things easier, the value can now be set via the hostname ("localhost/IPv*"), via the proto ("tcp/IPv*") or via setting $ENV{'IPV'} to '*'.

I do still agree that from angles, not defaulting to "*" is partially broken. However, I think safety for existing people is likely better at this point. And it should be remembered that many configuration systems of other software require you to use the IP address.

Update2: After all of the debate, and after my last comment, we still went with a change. Version 2.005 switched the default to IPv*.

my @a=qw(random brilliant braindead); print $a[rand(@a)];