Tom Schulz wrote:
Here is my debug output. It looks like the socket is created for
127.0.0.1 and then an attempt is also made for ::1. That fails as
expected. But in my case that failure causes a retry that includes
retrying for 127.0.0.1. This now fails because the port has already
been created (as noted in the error message). Retries then continue
until the retry limit is reached.

dbg: spamd: socket module of choice: IO::Socket::IP 0.32, Socket 2.013,
have PF_INET, have PF_INET6, using Socket::getaddrinfo, AI_ADDRCONFIG is
supported
dbg: spamd: socket specification: "localhost", IP address: localhost,
port: 783
dbg: spamd: attempting to listen on IP addresses: 127.0.0.1, ::1, port
783
dbg: spamd: creating IO::Socket::IP socket: Listen: 128, LocalAddr:
127.0.0.1, LocalPort: 783, Proto: tcp, ReuseAddr: 1, Type: 2, V6Only: 1
dbg: spamd: creating IO::Socket::IP socket: Listen: 128, LocalAddr: ::1,
LocalPort: 783, Proto: tcp, ReuseAddr: 1, Type: 2, V6Only: 1
server socket setup failed, retry 1: spamd: could not create
IO::Socket::IP socket on [::1]:783: Cannot assign requested address
dbg: spamd: attempting to listen on IP addresses: 127.0.0.1, ::1, port
783
dbg: spamd: creating IO::Socket::IP socket: Listen: 128, LocalAddr:
127.0.0.1, LocalPort: 783, Proto: tcp, ReuseAddr: 1, Type: 2, V6Only: 1
server socket setup failed, retry 2: spamd: could not create
IO::Socket::IP socket on [127.0.0.1]:783: Address already in use
dbg: spamd: attempting to listen on IP addresses: 127.0.0.1, ::1, port
783
dbg: spamd: creating IO::Socket::IP socket: Listen: 128, LocalAddr:
127.0.0.1, LocalPort: 783, Proto: tcp, ReuseAddr: 1, Type: 2, V6Only: 1
server socket setup failed, retry 3: spamd: could not create
IO::Socket::IP socket on [127.0.0.1]:783: Address already in use

Thanks, that explains how we get to 'Address already in use'.

This opens up a couple of questions:

- creating a socket listening on '::' apparently does work
(it is tested in the BEGIN phase, and reported by 'have PF_INET6'),
but creating a socket listening on '::1' (i.e. a loopback address)
fails. Are you running spamd in jail? Does a loopback interface
have an IPv6 address assigned? Is it '::1'? Or if you think the
IPv6 is not supported on that host, why then does creating a
socket listening on '::' succeed?

- why did it work with older versions of perl and modules

- this chain of events shows that the logic in server_sock_setup_inet()
and/or its caller is flawed. When multiple sockets are to be created
and not all succeed, we'd need to undo the successfully created
sockets before bailing out on error - or alternatively, make do
with partially fulfilling the request.

Please open up a ticket on the bugzilla.

  Mark

Reply via email to