Hello,
Chris Davies a écrit :
> Geoff Lane <(E-Mail Removed)> wrote:
>
>>Strangely if I issue the saned -d6 (Debug) command I get the output as
>>shown below;
>>
>>geoff@challenger:~$ saned -d6
>>[saned] main: starting debug mode (level 6)
>>[saned] main: trying to get port for service `sane-port' (getaddrinfo)
>>[saned] main: [0] socket () using IPv6
>>[saned] main: [0] setsockopt ()
>>[saned] main: [0] bind () to port 6566
>>[saned] main: [0] listen ()
>>[saned] main: [1] socket () using IPv4
>>[saned] main: [1] setsockopt ()
>>[saned] main: [1] bind () to port 6566
>>[saned] main: [1] bind failed: Address already in use
>
> That's because inetd has already allocated it.
I don't think so. I think that the system fails to bind an IPv4 socket
to port 6566 because the IPv6 socket has already been bound to this
port. This is the default on Linux for sockets listening on any address
(:: and 0.0.0.0), as an IPv6 socket listening on any address (:

also
accepts IPv4 connections.
See :
>> [saned] saned (AF-indep+IPv6) from sane-backends 1.0.18-cvs ready
>> [saned] check_host: detected an IPv4-mapped address
>> [saned] check_host: access by remote host: ::ffff:127.0.0.1
The IPv4 connection from 127.0.0.1 is received by the IPv6 socket and
the source IP address is seen as an IPv4-mapped IPv6 address
::ffff:127.0.0.1 as usual.
The default behaviour can be changed by setting the net.ipv6.bindv6only
sysctl to 1 so IPv6 sockets allow only IPv6 connections, and IPv6 and
IPv4 sockets can be bound to the same port.