run the following script
use strict qw(vars subs);
use IO::Socket;
use IO::Socket::INET6();
my $socket_ipv6 = IO::Socket::INET6->new(Listen => 10,
Domain =>
AF_INET6,
LocalAddr =>
'[::]',
LocalPort =>
6666);
$! = undef; # reset any OS error
my $socket_ipv4 = IO::Socket::INET6->new(Listen => 10,
Domain => AF_INET,
LocalAddr =>
'0.0.0.0',
LocalPort =>
6666);
print "error: $!\n" if $!;
print "SOCKET6 = $socket_ipv6\n";
print "SOCKET4 = $socket_ipv4\n";
<STDIN>;
- $! shows the error reported by the OS to Perl - my output on linux is:
linux:~ # perl ipv6_test.pl
error: Address already in use
SOCKET6 = IO::Socket::INET6=GLOB(0x82e6b54)
SOCKET4 =
Now - where is the BUG in Perl or a Perl module , if the OS says 'I can't
do what you want' - "Address already in use"
The OS is answering to both IPv4 and IPv6 at port 6666.
Thomas
Von: "William L. Thomson Jr." <[email protected]>
An: For Users of ASSP <[email protected]>
Datum: 26.06.2015 17:30
Betreff: Re: [Assp-user] Unable to log into web admin interface
On Friday, June 26, 2015 04:40:35 PM Thomas Eckardt wrote:
> >Oh really?
>
> YES, really!
No not really, maybe with more information you will understand... or
not...
> If there is a bug related to
>
> http://sourceforge.net/p/assp/mailman/message/33502973/
>
> it is NOT in IO::Socket::INET6.
Yes it is in that module per my example....
Run your example on Linux and see first hand for yourself. You can clearly
see
the error messages there. Which I ran into the same with my small perl
example
showing the issue. If you ran your test case on Linux vs FreeBSD you would
likely have run into the same issue as I did. Go find out for yourself.
> binding to 0.0.0.0 on linux is an IPv4 bind only. binding to [::] is for
> both IPv6 and IPv4 - at least on my nice old SLES OES2.
I will try with just [::] vs both IPv4 and IPv6 wildcard. However I bet it
will just listen on IPv6 and NOT IPv4. Really some what pointless to try
that
as I know the outcome already...
Also you realize that goes against your previous examples right? Your test
perl showed both 0.0.0.0 and [::] Why would that be necessary if your
implied
[::] works for both IPv4 and IPv6? Fact is it does not thus you need to
bind
and listen to both to fully support both protocols.
Using [::] for IPv4 is just flat out wrong.
Anything else needs to bind to them independently, for example
/etc/dovecot/dovecot.conf
A comma separated list of IPs or hosts where to listen in for
connections.
# "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces.
# If you want to specify non-default ports or anything more complex,
# edit conf.d/master.conf.
listen = *,[::]
You can clearly see * is used for IPv4, and [::] is used for IPv6.
> This is caused by the system , not by Perl nor by any Perl module.
>
> You can check this simple:
> change (uncommend) both lines - in the /etc/ssh/sshd_config
>
> #ListenAddress 0.0.0.0
> #ListenAddress [::]
>
> and restart the sshd - now check netstat - in my case I see only the
> following listener at port 22
>
> tcp 0 0 :::22 :::* LISTEN
>
> but the sshd accepts connection with IPv4 also.
That is because IPv6 can support IPv4, IPv4 in IPv6, ::ffff:0.0.0.0/96.
https://tools.ietf.org/html/rfc3493#section-3.7
Which that can be disabled, so its not something to rely upon.
https://tools.ietf.org/html/rfc3493#section-5.3
Understand it is NOT listening on 0.0.0.0:22, which your netstat clearly
shows. That is a misunderstanding of how IPv6 works. Also you have to
confirm
you are using a IPv4 address to connect to 0.0.0.0:22. I bet if you use a
IPv4
to connect to port 22 you cannot as it is not listening on that port. If
you
use a IPv4 address to connect to something listening on a IPv6 wildcard,
your
using IPv4 in IPv6 to make that work.
--
William L. Thomson Jr.
Obsidian-Studios, Inc.
http://www.obsidian-studios.com
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Assp-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/assp-user
DISCLAIMER:
*******************************************************
This email and any files transmitted with it may be confidential, legally
privileged and protected in law and are intended solely for the use of the
individual to whom it is addressed.
This email was multiple times scanned for viruses. There should be no
known virus in this email!
*******************************************************
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Assp-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/assp-user