From owner-freebsd-current Thu Jul 18 10: 0:34 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8EEDC37B400 for ; Thu, 18 Jul 2002 10:00:26 -0700 (PDT) Received: from energistic.com (bdsl.66.12.217.106.gte.net [66.12.217.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5541743E31 for ; Thu, 18 Jul 2002 10:00:25 -0700 (PDT) (envelope-from steve@energistic.com) Received: from energistic.com (steve@localhost [127.0.0.1]) by energistic.com (8.12.5/8.12.5) with ESMTP id g6IH0NHH071223; Thu, 18 Jul 2002 12:00:24 -0500 (EST) (envelope-from steve@energistic.com) Received: (from steve@localhost) by energistic.com (8.12.5/8.12.5/Submit) id g6IH0M5g070374; Thu, 18 Jul 2002 12:00:22 -0500 (EST) Date: Thu, 18 Jul 2002 12:00:22 -0500 From: Steve Ames To: current@FreeBSD.ORG Cc: bright@mu.org Subject: [patch] Re: inetd parsing broke for non IPv6 configurations Message-ID: <20020718170022.GA85314@energistic.com> References: <200207171936.g6HJak6H054672@energistic.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200207171936.g6HJak6H054672@energistic.com> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG The following patch fixes this problem for me. When a tcp6 was encountered then v6bind is set to 1 and was not being cleared after the check to ignore IPv6. This patch may not be entirely correct, but its simple and does fix the problem I reported earlier. The v4bind check that should have resulted in clearing v6bind back to 0 seems a bit questionable. I believe the flag should be cleared always. -Steve --------------------------------------------------------- --- inetd.c.old Mon Jul 15 14:09:33 2002 +++ inetd.c Thu Jul 18 11:53:55 2002 @@ -1726,12 +1726,9 @@ if (v6bind != 0 && no_v6bind != 0) { syslog(LOG_INFO, "IPv6 bind is ignored for %s", sep->se_service); - if (v4bind && no_v4bind == 0) - v6bind = 0; - else { - freeconfig(sep); - goto more; - } + v6bind = 0; + freeconfig(sep); + goto more; } if (v6bind != 0) { sep->se_family = AF_INET6; --------------------------------------------------------- -Steve On Wed, Jul 17, 2002 at 02:36:46PM -0500, Steve Ames wrote: > > This worked 3 days ago but I just upgraded to -CURRENT from today > and its not quite working now. If you have tcp6 lines in your > inetd.conf but do not have IPv6 enabled in the kernel your inetd > will stop adding services after it encounters the first line with > a tcp6 in it: > > mysystem# inetd -d > ADD : ftp proto=tcp accept=1 max=0 user=root group=(null)class=daemon builtin=0x > 0 server=/usr/libexec/ftpd policy="" > inetd: ftp/tcp: ipsec initialization failed; in entrust > inetd: ftp/tcp: ipsec initialization failed; tut entrust > inetd: enabling ftp, fd 4 > inetd: registered /usr/libexec/ftpd on 4 > inetd[52984]: IPv6 bind is ignored for ftp > inetd[52984]: IPv6 bind is ignored for telnet > inetd[52984]: IPv6 bind is ignored for telnet > inetd[52984]: IPv6 bind is ignored for comsat > inetd[52984]: IPv6 bind is ignored for ntalk > inetd[52984]: IPv6 bind is ignored for pop3 > inetd[52984]: IPv6 bind is ignored for imap4 > inetd[52984]: IPv6 bind is ignored for imaps > inetd[52984]: IPv6 bind is ignored for auth > inetd[52984]: IPv6 bind is ignored for auth > inetd[52984]: IPv6 bind is ignored for gpsclock > > Here it correctly adds ftp/tcp and ignores ftp/tcp6... but then it > appears to see all remaining entries as tcp6 and ignores them even > when they are most certainly listed as tcp and not tcp6. > > I'm guessing that > > $FreeBSD: src/usr.sbin/inetd/inetd.c,v 1.105 2002/07/15 19:09:33 > > is the culprit. This commit was to add support for rpc IPv6 and > does appear to change the code block where the "IPv6 bind is > ignored" appears.. > > -Steve > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message