Bug#666651: Bug#667737: libnet-server-perl: no IPv4 server when binding to localhost

2012-05-02 Thread Per Carlson
Hi Daniel.

A bit late maybe, but...

> At its core, there's a concern here that asking a server to bind to a
> name might actually bind it to multiple addresses (since a name can have
> multiple addresses).  I'm not convinced that Net::Server can be properly
> made to bind to multiple addresses with a single "host" configuration,
> but i agree that for the sake of congruity with the rest of the perl
> world, Net::Server should preferentially bind to the IPv4 address if a
> given name maps to both an IPv4 and an IPv6 address.

I don't agree with you (and "the rest of the perl world") here on a
general basis. getaddrinfo returns any IPv6 addresses before IPv4 *by
design*. If it were the other way around the (inevitable) transition
to IPv6 would be much harder. Of course this is only true if asking
for AF_UNSPEC (or the trivial AF_INET6) records.

In that light rewriting Net::Server to always prioritize IPv4 is dead
wrong and should be avoided. If selecting an IPv6 address is causing
any problems, this is most likely caused by old IPv4-only mindset
(like localhost always and only resolves to 127.0.0.1). If "we" are
going to have success in the v4->v6 transition this mindset must be
changed instead of breaking IPv6.

I do support your rewrite to 5.14 core modules for "native" IPv6
functionality, but not this "do not break any (already broken) IPv4
applications".

-- 
Pelle

"D’ä e å, vett ja”, skrek ja, för ja ble rasen,
”å i åa ä e ö, hörer han lite, d’ä e å, å i åa ä e ö"
- Gustav Fröding, 1895



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#666651: Bug#667737: libnet-server-perl: no IPv4 server when binding to localhost

2012-04-07 Thread intrigeri
gregor herrmann wrote (06 Apr 2012 20:03:29 GMT) :
> Could any of our more IPv6-savvy members (dkg? intrigeri?) take
> a look at this patch?

For the record, I doubt very much I'm more IPv6-savvy than anyone
else here.

Cheers!
-- 
  intrigeri
  | GnuPG key @ https://gaffer.ptitcanardnoir.org/intrigeri/intrigeri.asc
  | OTR fingerprint @ https://gaffer.ptitcanardnoir.org/intrigeri/otr.asc



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#666651: Bug#667737: libnet-server-perl: no IPv4 server when binding to localhost

2012-04-06 Thread Daniel Kahn Gillmor
On 04/06/2012 04:03 PM, gregor herrmann wrote:
> On Fri, 06 Apr 2012 14:02:41 +0300, Niko Tyni wrote:
> 
>> Unfortunately libnet-server-perl currently only binds an IPv6 socket
>> when asked for 'localhost' if localhost is both 127.0.0.1 and ::1 in
>> /etc/hosts.  I think this is a bug. Consider a server:
>>
>>  # perl -MNet::Server -e 'package S; use base q/Net::Server/; sub 
>> process_request { print qq(hello, world!\n) }; S->run(port => 1600, host => 
>> q/localhost/)'
>>  2012/04/06-13:17:11 S (type Net::Server) starting! pid(3802)
>>  Using default listen value of 128
>>  Binding to TCP port 1600 on host localhost
>>  Group Not Defined.  Defaulting to EGID '1000 20 27 29 119 1000'
>>  User Not Defined.  Defaulting to EUID '1000'
>>
>> and a client:
>>
>>  # grep localhost /etc/hosts
>>  127.0.0.1   localhost
>>  ::1 localhost ip6-localhost ip6-loopback
>>
>>  # telnet 127.0.0.1 1600
>>  Trying 127.0.0.1...
>>  telnet: Unable to connect to remote host: Connection refused
>>
>>  # telnet localhost 1600
>>  Trying ::1...
>>  Connected to localhost.
>>  Escape character is '^]'.
>>  hello, world!
>>  Connection closed by foreign host.
>>
>> I'm cloning a bug about this. It's clearly Debian specific behaviour,
>> as the IPv6 support was patched in with 0.99-3. I think it's bad enough
>> to be considered release critical, but other pkg-perl folks should feel
>> free to downgrade if they disagree.
> 
> Ouch, that's indeed nasty.
> Could any of our more IPv6-savvy members (dkg? intrigeri?) take a look
> at this patch?

I have (on my list of things to do) a project to rewrite debian's
Net::Server IPv6 support without reference to Socket6 or
IO::Socket::INET6.  This would create a versioned dependency on
perl-modules for a recent version of Socket (i think 5.14 is needed),
but it would also reduce our dependencies on out-of-core modules, and it
is an opportunity to overhaul this code and get it Right if possible.

I already submitted a similar patch for HTTP::Server::Simple upstream
[0], so i've dug around in this space a bit.

At its core, there's a concern here that asking a server to bind to a
name might actually bind it to multiple addresses (since a name can have
multiple addresses).  I'm not convinced that Net::Server can be properly
made to bind to multiple addresses with a single "host" configuration,
but i agree that for the sake of congruity with the rest of the perl
world, Net::Server should preferentially bind to the IPv4 address if a
given name maps to both an IPv4 and an IPv6 address.

If folks feel like this would address the problem described in this
ticket, i'm happy to try to bump the Net::Server IPv6 overhaul up in my
queue.

I'd be happy to collaborate with anyone interested on it, of course.

--dkg

[0] https://rt.cpan.org/Ticket/Display.html?id=61200#txn-1054169



signature.asc
Description: OpenPGP digital signature


Bug#666651: Bug#667737: libnet-server-perl: no IPv4 server when binding to localhost

2012-04-06 Thread gregor herrmann
On Fri, 06 Apr 2012 14:02:41 +0300, Niko Tyni wrote:

> Unfortunately libnet-server-perl currently only binds an IPv6 socket
> when asked for 'localhost' if localhost is both 127.0.0.1 and ::1 in
> /etc/hosts.  I think this is a bug. Consider a server:
> 
>  # perl -MNet::Server -e 'package S; use base q/Net::Server/; sub 
> process_request { print qq(hello, world!\n) }; S->run(port => 1600, host => 
> q/localhost/)'
>  2012/04/06-13:17:11 S (type Net::Server) starting! pid(3802)
>  Using default listen value of 128
>  Binding to TCP port 1600 on host localhost
>  Group Not Defined.  Defaulting to EGID '1000 20 27 29 119 1000'
>  User Not Defined.  Defaulting to EUID '1000'
> 
> and a client:
> 
>  # grep localhost /etc/hosts
>  127.0.0.1   localhost
>  ::1 localhost ip6-localhost ip6-loopback
> 
>  # telnet 127.0.0.1 1600
>  Trying 127.0.0.1...
>  telnet: Unable to connect to remote host: Connection refused
> 
>  # telnet localhost 1600
>  Trying ::1...
>  Connected to localhost.
>  Escape character is '^]'.
>  hello, world!
>  Connection closed by foreign host.
> 
> I'm cloning a bug about this. It's clearly Debian specific behaviour,
> as the IPv6 support was patched in with 0.99-3. I think it's bad enough
> to be considered release critical, but other pkg-perl folks should feel
> free to downgrade if they disagree.

Ouch, that's indeed nasty.
Could any of our more IPv6-savvy members (dkg? intrigeri?) take a look
at this patch?

Cheers,
gregor
 
-- 
 .''`.  Homepage: http://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06
 : :' : Debian GNU/Linux user, admin, and developer  -  http://www.debian.org/
 `. `'  Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `-   NP: Die Schmetterlinge: Lied von der menschlichen Gemeinheit


signature.asc
Description: Digital signature