From owner-freebsd-current Mon May 29 8: 3:28 2000 Delivered-To: freebsd-current@freebsd.org Received: from point.osg.gov.bc.ca (point.osg.gov.bc.ca [142.32.102.44]) by hub.freebsd.org (Postfix) with ESMTP id AF54137B68B; Mon, 29 May 2000 08:03:18 -0700 (PDT) (envelope-from Cy.Schubert@uumail.gov.bc.ca) Received: (from daemon@localhost) by point.osg.gov.bc.ca (8.8.7/8.8.8) id IAA17996; Mon, 29 May 2000 08:02:34 -0700 Received: from passer.osg.gov.bc.ca(142.32.110.29) via SMTP by point.osg.gov.bc.ca, id smtpda17994; Mon May 29 08:02:24 2000 Received: (from uucp@localhost) by passer.osg.gov.bc.ca (8.9.3/8.9.1) id IAA12365; Mon, 29 May 2000 08:02:23 -0700 (PDT) Received: from cwsys9.cwsent.com(10.2.2.1), claiming to be "cwsys.cwsent.com" via SMTP by passer9.cwsent.com, id smtpdd12351; Mon May 29 08:01:51 2000 Received: (from uucp@localhost) by cwsys.cwsent.com (8.10.1/8.9.1) id e4TF1nr01222; Mon, 29 May 2000 08:01:49 -0700 (PDT) Message-Id: <200005291501.e4TF1nr01222@cwsys.cwsent.com> Received: from localhost.cwsent.com(127.0.0.1), claiming to be "cwsys" via SMTP by localhost.cwsent.com, id smtpdgq1218; Mon May 29 08:01:37 2000 X-Mailer: exmh version 2.1.1 10/15/1999 Reply-To: Cy Schubert - ITSD Open Systems Group From: Cy Schubert - ITSD Open Systems Group X-OS: FreeBSD 4.0-STABLE X-Sender: cy To: Hajimu UMEMOTO (=?ISO-2022-JP?B?GyRCR19LXBsoQiA=?= =?ISO-2022-JP?B?GyRCSCUbKEI=?=) Cc: andrews@technologist.com, Cy.Schubert@uumail.gov.bc.ca, stable@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: ftp(1) breakage w/ passive mode? In-reply-to: Your message of "Mon, 29 May 2000 19:35:26 +0900." <20000529193526V.ume@bisd.hitachi.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 29 May 2000 08:01:35 -0700 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This might even solve my Kerberos V problem when IPv6 is enabled in the kernel. Regards, Phone: (250)387-8437 Cy Schubert Fax: (250)387-5766 Team Leader, Sun/DEC Team Internet: Cy.Schubert@osg.gov.bc.ca Open Systems Group, ITSD, ISTA Province of BC In message <20000529193526V.ume@bisd.hitachi.co.jp>, Hajimu UMEMOTO writes: > ----Next_Part(Mon_May_29_19:35:22_2000_809)-- > Content-Type: Text/Plain; charset=us-ascii > Content-Transfer-Encoding: 7bit > > >>>>> On Sun, 28 May 2000 21:04:23 -0400 > >>>>> Will Andrews said: > > > What would make ftp(1) think it has an IPv6 connection? > > andrews> I have no idea.. > > It seems ftp(1) think using IPv6. > > There is a bug in existing getaddrinfo(). getaddrinfo() returns IPv4 > address as IPv4 mapped IPv6 address in some case. It occures when: > > - INET6 is enabled in kernel > - host has A RR and AAAA RR > > IPv4 connection via mapped address is still IPv6 connection. In this > case, if ftp(1) doesn't have awareness of using mapped address, your > problem will occur. And, ftp(1) seems not aware about it. > > But, it seems ftp.FreeBSD.org does't have AAAA RR. So, I believe it > is not applicable to your case. And, actually I dont' see this > problem here. However, I have no idea without this case. So, I > attach the patch to solve getaddrinfo() problem. Please try it and I > would like to hear the result. > > > ----Next_Part(Mon_May_29_19:35:22_2000_809)-- > Content-Type: Text/Plain; charset=us-ascii > Content-Transfer-Encoding: 7bit > Content-Description: getaddrinfo-mapped-workaround.diff > Content-Disposition: attachment; > filename="getaddrinfo-mapped-workaround.diff" > > Index: lib/libc/net/getaddrinfo.c > diff -u lib/libc/net/getaddrinfo.c.orig lib/libc/net/getaddrinfo.c > --- lib/libc/net/getaddrinfo.c.orig Thu Apr 20 12:31:40 2000 > +++ lib/libc/net/getaddrinfo.c Mon Apr 24 21:41:24 2000 > @@ -148,6 +148,7 @@ > static int get_portmatch __P((const struct addrinfo *, const char *)); > static int get_port __P((struct addrinfo *, const char *, int)); > static const struct afd *find_afd __P((int)); > +static void unmappedaddr __P((struct addrinfo *)); > > static char *ai_errlist[] = { > "Success", > @@ -512,6 +513,7 @@ > */ > GET_CANONNAME(cur->ai_next, hp->h_name); > } > + unmappedaddr(cur->ai_next); > > while (cur && cur->ai_next) > cur = cur->ai_next; > @@ -903,4 +905,25 @@ > return afd; > } > return NULL; > +} > + > +static void > +unmappedaddr(struct addrinfo *res) > +{ > + struct sockaddr_in6 *sin6; > + struct sockaddr_in *sin; > + u_int32_t addr; > + int port; > + > + sin6 = (struct sockaddr_in6 *)res->ai_addr; > + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { > + sin = (struct sockaddr_in *)res->ai_addr; > + addr = *(u_int32_t *)&sin6->sin6_addr.s6_addr[12]; > + port = sin6->sin6_port; > + memset(res->ai_addr, 0, res->ai_addrlen); > + sin->sin_addr.s_addr = addr; > + sin->sin_port = port; > + sin->sin_family = res->ai_family = AF_INET; > + sin->sin_len = res->ai_addrlen = sizeof(struct sockaddr_in); > + } > } > > ----Next_Part(Mon_May_29_19:35:22_2000_809)-- > Content-Type: Text/Plain; charset=us-ascii > Content-Transfer-Encoding: 7bit > Content-Description: My Signature > Content-Disposition: attachment; filename=".signature-world" > > Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan > ume@mahoroba.org ume@bisd.hitachi.co.jp ume@FreeBSD.org > http://www.imasy.org/~ume/ > > ----Next_Part(Mon_May_29_19:35:22_2000_809)---- > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-stable" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message