Subject: Re: pkg/10972: editors/emacs does not work correctly (IPV6 support seems incorrect)
To: None <boquist@crt.se>
From: Love <lha@stacken.kth.se>
List: netbsd-bugs
Date: 09/07/2000 23:03:22
boquist@crt.se writes:

> >Description:
> 	When emacs is configured to use IPV6 (--with-ipv6 flag) the
> 	builtin LISP function open-network-stream does not work. The
> 	example below demonstrates this. For me it fails with:
> 
> 		error creating socket: protocol not supported, mail

Ok, I think you contacted a host with a AAAA (or A6) rr, but you kernel
doesn't support IPv6.

The patch that adds getaddrinfo support (patch-aj) have forgotten to ignore
errors from socket() (but not connect()). A simular construction is needed
for connect().

Sorry that I can't provide a fix (no bandwidth to get an emacs). But it
should look something like this:

in src/process.c after patch-aj

      s = socket(lres->ai_family, lres->ai_socktype, lres->ai_protocol);
-     if (s < 0) 
-       report_file_error ("error creating socket", Fcons (name, Qnil));
+     if (s < 0) {
+       if (lres->ai_next) {
+         lres = lres->ai_next;
+         goto addrloop;
+       }
+       
+       report_file_error ("error creating socket", Fcons (name, Qnil));
+     }

Love