From owner-freebsd-net@FreeBSD.ORG Sun Sep 17 11:11:27 2006 Return-Path: X-Original-To: net@freebsd.org Delivered-To: freebsd-net@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BC30216A587; Sun, 17 Sep 2006 11:11:27 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from ameno.mahoroba.org (gw4.mahoroba.org [218.45.22.175]) by mx1.FreeBSD.org (Postfix) with ESMTP id B957243D60; Sun, 17 Sep 2006 11:11:26 +0000 (GMT) (envelope-from ume@mahoroba.org) Received: from kasuga.mahoroba.org (IDENT:PTVemcoM03+nrhJE8PglxlnNyBCTQEWiUCLbyF74+FNaSLapT3cG5sxqq6bcgW9C@kasuga-iwi.mahoroba.org [IPv6:2001:2f0:104:8010:212:f0ff:fe52:6ac]) (user=ume mech=CRAM-MD5 bits=0) by ameno.mahoroba.org (8.13.8/8.13.8) with ESMTP/inet6 id k8HBAmi1084423 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 17 Sep 2006 20:10:48 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Sun, 17 Sep 2006 20:10:47 +0900 Message-ID: From: Hajimu UMEMOTO To: "Julian Stacey" In-Reply-To: <200609141344.k8EDiI42092840@flat.berklix.org> References: <200609141344.k8EDiI42092840@flat.berklix.org> User-Agent: xcite1.38> Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.0.50 (i386-pc-freebsd) MULE/5.0 (SAKAKI) X-Operating-System: FreeBSD 6.2-PRERELEASE X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-3.0a6 (ameno.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Sun, 17 Sep 2006 20:10:49 +0900 (JST) X-Virus-Scanned: by amavisd-new X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.1.5 X-Spam-Checker-Version: SpamAssassin 3.1.5 (2006-08-29) on ameno.mahoroba.org Cc: Gary Jennejohn , brian@Awfulhak.org, net@freebsd.org Subject: Re: ppp command port does not listens on ipv4 unless no INET6 in kernel X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Sep 2006 11:11:27 -0000 Hi, >>>>> On Thu, 14 Sep 2006 15:44:18 +0200 (CEST) >>>>> "Julian Stacey" said: jhs> I'm not clear if this is a bug or a config error: jhs> It seems though my /usr/sbin/ppp was moving traffic jhs> to & from internet, it was only listening for commands jhs> (not data) on ipv6, not ipv4, thus I could not type commands jhs> like dial & drop, unless instead of running ppp -auto jhs> instead I invoked ppp manually in foreground on localhost. As far as I read the source of ppp(8), it only listen on an IPv6, and expects to listen on an IPv4 through an IPv4-mapped IPv6 address. However, an IPv4-mapped IPv6 address feature is disabled by default. ppp(8) should be rewritten to listen on both an IPv4 and an IPv6. But, it is slightly complex. So, I made a patch to enable an IPv4-mapped IPv6 address only for the socket that ppp(8) is listening on. I have no environment for testing this. Could you try this patch? Index: usr.sbin/ppp/server.c diff -u -p usr.sbin/ppp/server.c.orig usr.sbin/ppp/server.c --- usr.sbin/ppp/server.c.orig Sun Sep 5 10:46:52 2004 +++ usr.sbin/ppp/server.c Sun Sep 17 19:54:43 2006 @@ -346,6 +346,13 @@ server_TcpOpen(struct bundle *bundle, u_ goto failed; } +#ifndef NOINET6 + if (probe.ipv6_available) { + int off = 0; + setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&off, sizeof(off)); + } +#endif + setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &s, sizeof s); if (bind(s, (struct sockaddr *)&ss, sz) < 0) { log_Printf(LogWARN, "Tcp: bind: %s\n", strerror(errno)); Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/