[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

broken IPv6 code



Hello,

could someone please tell me what is wrong with this code?

socket(PF_INET6, SOCK_STREAM, 6)        = 3
setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(3, {sin_family=AF_INET6, sin6_port=htons(8024), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=htonl(0)}}, 24) = 0
listen(3, 128)                          = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 4
setsockopt(4, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(4, {sin_family=AF_INET, sin_port=htons(8024), sin_addr=inet_addr("0.0.0.0")}}, 16) = -1 EADDRINUSE (Address already in use)
write(2, "telnetd: ", 9telnetd: )                = 9
write(2, "bind", 4bind)                     = 4
write(2, ": ", 2: )                       = 2
write(2, "Address already in use\n", 23Address already in use
) = 23
_exit(1)                                = ?


Debian potato, 2.2.18, and no, port 8024 is not already in use.

As far as I am aware, this is the standard way of binding both to IPv6
and IPv4, however, it obvious does not work. It this a kernel bug?  a
glibc bug? or a bug in the above code?

(the code is from telnetd in heimdal-servers from unstable).
-- 
Brian May <bam@debian.org>



Reply to: