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

bugs



Hi,

rlinetd-0.4 still doesn't work properly when family ipv{4,6} is specified.
Maybe this is getaddrinfo() problem - who knows ;-) but even if getaddrinfo
will be ok rlinetd won't work properly !

If you don't belive try this patch (it is workaround for getaddrinfo()):

diff -urN rlinetd-0.4.orig/grammar.y rlinetd-0.4/grammar.y
--- rlinetd-0.4.orig/grammar.y  Sun Jul 25 19:54:29 1999
+++ rlinetd-0.4/grammar.y       Sun Jul 25 19:57:04 1999
@@ -953,6 +953,9 @@
                                protocol = ai->ai_protocol;
                                saddr = ai->ai_addr;
                                saddrlen = ai->ai_addrlen;
+
+                               if ((family != current_service->family) && (current_service->family != PF_UNSPEC))
+                                       continue;
 #else
                                portnum = strtoul(port, &ctmp, 10);
                                if(*ctmp) {

Problem is in binding to IPv6 Wildcard Address (IN6ADDR_ANY_INIT) ...
For example:
      struct sockaddr_in6 sin6;
       . . .
      sin6.sin6_family = AF_INET6;
      sin6.sin6_flowinfo = 0;
      sin6.sin6_port = htons(23);
      sin6.sin6_addr = in6addr_any;
       . . .
      if (bind(s, (struct sockaddr *) &sin6, sizeof(sin6)) == -1)
              . . .
and program will bind to all interfaces (IPv6 and IPv4!)

RFC2553 says
   "...When applications use PF_INET6 sockets
   to accept TCP connections from IPv4 nodes, or receive UDP packets
   from IPv4 nodes, the system returns the peer's address ..."

so it seems that my teory is true (bind() on wildcard causes binding
to Ipv4 interfaces, too)... If it is realy true this must be
workarounded in rlinetd or RFC must be changed :-)

I belive that second resolution is better for all but...

With my small workaround with getaddrinfo():
- family ipv4; works fine because we are using ipv4 wildcard - INADDR_ANY
- family ipv6; works badly ;(

-- 
 _____  __    ____       arkadiusz miśkiewicz      misiek@pld.org.pl
 \  _  \\  \  \    \           sysadm: zsz2.starachowice.pl
 |   __/|  |__|  |  | http://www.pld.org.pl/ http://www.misiek.eu.org/
 /__/   /____//____/     Polish Linux Distribution with IPv6 support