From owner-freebsd-rc@FreeBSD.ORG Mon Oct 17 11:02:04 2005 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5BFAD16A41F for ; Mon, 17 Oct 2005 11:02:04 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2927543D49 for ; Mon, 17 Oct 2005 11:02:04 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j9HB24H0022479 for ; Mon, 17 Oct 2005 11:02:04 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j9HB23ec022473 for freebsd-rc@freebsd.org; Mon, 17 Oct 2005 11:02:03 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 17 Oct 2005 11:02:03 GMT Message-Id: <200510171102.j9HB23ec022473@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-rc@FreeBSD.org Cc: Subject: Current problem reports assigned to you X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2005 11:02:04 -0000 Current FreeBSD problem reports Critical problems Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2005/02/10] conf/77340 rc awk used in /etc/rc.d/nsswitch when not a 1 problem total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2004/06/30] conf/68525 rc Loader's verbose boot mode has rc.d/local o [2004/07/07] conf/68745 rc /etc/rc.d/devfs runs after ntpd so links o [2005/05/14] kern/81006 rc ipnat not working with tunnel interfaces 3 problems total. From owner-freebsd-rc@FreeBSD.ORG Mon Oct 17 21:09:11 2005 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BF7A716A41F for ; Mon, 17 Oct 2005 21:09:11 +0000 (GMT) (envelope-from cryx-freebsd@h3q.com) Received: from mail.h3q.com (mail.h3q.com [217.13.206.148]) by mx1.FreeBSD.org (Postfix) with ESMTP id EFF3643D4C for ; Mon, 17 Oct 2005 21:09:10 +0000 (GMT) (envelope-from cryx-freebsd@h3q.com) Received: (qmail 76934 invoked from network); 17 Oct 2005 21:08:30 -0000 Received: from unknown (HELO ?23.23.23.242?) (cryx@212.202.201.68) by mail.h3q.com with AES256-SHA encrypted SMTP; 17 Oct 2005 21:08:30 -0000 Message-ID: <435412F7.2030906@h3q.com> Date: Mon, 17 Oct 2005 23:09:11 +0200 From: Philipp Wuensche User-Agent: Mozilla Thunderbird 1.0.7 (Macintosh/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-rc@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: alias configuration in rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2005 21:09:11 -0000 Hi, I don't know if this is the right place, but I created a patch to /etc/network.subr and /etc/rc.d/netif to add a simpler alias configuration in rc.conf. Using the ifconfig_fxp0_aliasN="" syntax is error prone. If you forget to number N serially correct, /etc/rc.d/netif does not configure all aliases to the interface. Other weird things happen if N is not uniqe. Configuring a large number of aliases to an interface (e.g. in jail-hosting systems) fills up the rc.conf very fast, making the configuration complex. With the patches, alias configuration gets a lot easier. At the moment I use the ipv4_ifconfig variable, its not jet used. Mayby something else would be better. Using ranges in the last byte of the ipaddr. allows to configure more than one ipaddr in one statement. The syntax is as follow: ipv4_ifconfig_fxp0="192.168.0.1/24 23.23.23.5-23/24" This will configure fxp0 with the alias 192.168.0.1/24, 23.23.23.5/24 and 23.23.23.6-23/32 You can find the patch at http://outpost.h3q.com/patches/network.subr-range.patch Comments and testreports are very welcome :-) greetings, cryx From owner-freebsd-rc@FreeBSD.ORG Mon Oct 17 21:53:13 2005 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C6AAA16A41F for ; Mon, 17 Oct 2005 21:53:13 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id C1F0B43D5C for ; Mon, 17 Oct 2005 21:53:09 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id j9HLr9vC024900; Mon, 17 Oct 2005 14:53:09 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j9HLr9wf024899; Mon, 17 Oct 2005 14:53:09 -0700 Date: Mon, 17 Oct 2005 14:53:09 -0700 From: Brooks Davis To: Philipp Wuensche Message-ID: <20051017215309.GH15097@odin.ac.hmc.edu> References: <435412F7.2030906@h3q.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <435412F7.2030906@h3q.com> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu Cc: freebsd-rc@freebsd.org Subject: Re: alias configuration in rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2005 21:53:13 -0000 On Mon, Oct 17, 2005 at 11:09:11PM +0200, Philipp Wuensche wrote: > Hi, > > I don't know if this is the right place, but I created a patch to > /etc/network.subr and /etc/rc.d/netif to add a simpler alias > configuration in rc.conf. > > Using the ifconfig_fxp0_aliasN="" syntax is error prone. If you forget > to number N serially correct, /etc/rc.d/netif does not configure all > aliases to the interface. Other weird things happen if N is not uniqe. > > Configuring a large number of aliases to an interface (e.g. in > jail-hosting systems) fills up the rc.conf very fast, making the > configuration complex. > > With the patches, alias configuration gets a lot easier. At the moment I > use the ipv4_ifconfig variable, its not jet used. Mayby something else > would be better. Using ranges in the last byte of the ipaddr. allows to > configure more than one ipaddr in one statement. > > The syntax is as follow: > > ipv4_ifconfig_fxp0="192.168.0.1/24 23.23.23.5-23/24" > > This will configure fxp0 with the alias 192.168.0.1/24, 23.23.23.5/24 > and 23.23.23.6-23/32 > > You can find the patch at > http://outpost.h3q.com/patches/network.subr-range.patch > > Comments and testreports are very welcome :-) Nice idea! The aliasN stuff is ugly. Some comments: I don't like ipv4_ifconfig_fxp0. I'd suggest ifconfig_fxp0_ipv4_aliases instead. The ipv4_ifconfig_getargs function is slightly bogus as written since a default value makes no sense and that would be the wrong one anyway. The implemenation also fails to match the comment though that's easy to fix. I'd also not modify etc/rc.d/netif and do this from ifalias_up(). Corresponding ifalias_down() support should also be added. Finally modifications will be needed to rc.conf(5). -- Brooks From owner-freebsd-rc@FreeBSD.ORG Tue Oct 18 00:37:57 2005 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8EE6816A41F for ; Tue, 18 Oct 2005 00:37:57 +0000 (GMT) (envelope-from cryx-freebsd@h3q.com) Received: from mail.h3q.com (mail.h3q.com [217.13.206.148]) by mx1.FreeBSD.org (Postfix) with ESMTP id 679E943D45 for ; Tue, 18 Oct 2005 00:37:55 +0000 (GMT) (envelope-from cryx-freebsd@h3q.com) Received: (qmail 98751 invoked from network); 18 Oct 2005 00:37:15 -0000 Received: from unknown (HELO ?192.168.23.34?) (cryx@85.178.78.60) by mail.h3q.com with AES256-SHA encrypted SMTP; 18 Oct 2005 00:37:15 -0000 Message-ID: <435443DE.6090300@h3q.com> Date: Tue, 18 Oct 2005 02:37:50 +0200 From: Philipp Wuensche User-Agent: Mozilla Thunderbird 1.0.7 (Macintosh/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Brooks Davis References: <435412F7.2030906@h3q.com> <20051017215309.GH15097@odin.ac.hmc.edu> In-Reply-To: <20051017215309.GH15097@odin.ac.hmc.edu> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: alias configuration in rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2005 00:37:57 -0000 Brooks Davis wrote: > > I don't like ipv4_ifconfig_fxp0. I'd suggest ifconfig_fxp0_ipv4_aliases > instead. Good idea, the ipv4_ifconfig was just a placeholder more ore less. But why is there a differentiation between adding the first ipaddr. to the interface and adding anoter one anyway? Part of my idea (not implemented in this piece of code) was to use ifconfig_if (or ifconfig_if_option) for interface options only and use ipv4_ and ipv6_ifconfig_if to configure the ipaddr. of the interface. This would make no difference between adding the first ipaddr and adding more. Just for the record ;-). > The ipv4_ifconfig_getargs function is slightly bogus as > written since a default value makes no sense and that would be the wrong > one anyway. The implemenation also fails to match the comment though > that's easy to fix. I'd also not modify etc/rc.d/netif and do this from > ifalias_up(). I moved everything to ifalias_up() keeping the other aliasN stuff. > Corresponding ifalias_down() support should also be added. Done. > Finally modifications will be needed to rc.conf(5). Yes and /etc/defaults/rc.conf also. Once again, I made the patch available at http://outpost.h3q.com/patches/network.subr-range.patch greetings, cryx From owner-freebsd-rc@FreeBSD.ORG Tue Oct 18 01:52:34 2005 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 81FA316A41F for ; Tue, 18 Oct 2005 01:52:34 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 27BD243D53 for ; Tue, 18 Oct 2005 01:52:34 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id j9I1qX5E027725; Mon, 17 Oct 2005 18:52:33 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j9I1qXo7027724; Mon, 17 Oct 2005 18:52:33 -0700 Date: Mon, 17 Oct 2005 18:52:33 -0700 From: Brooks Davis To: Philipp Wuensche Message-ID: <20051018015233.GA20157@odin.ac.hmc.edu> References: <435412F7.2030906@h3q.com> <20051017215309.GH15097@odin.ac.hmc.edu> <435443DE.6090300@h3q.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline In-Reply-To: <435443DE.6090300@h3q.com> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu Cc: freebsd-rc@freebsd.org Subject: Re: alias configuration in rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2005 01:52:34 -0000 --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 18, 2005 at 02:37:50AM +0200, Philipp Wuensche wrote: > Brooks Davis wrote: > >=20 > > I don't like ipv4_ifconfig_fxp0. I'd suggest ifconfig_fxp0_ipv4_aliases > > instead. =20 >=20 > Good idea, the ipv4_ifconfig was just a placeholder more ore less. But > why is there a differentiation between adding the first ipaddr. to the > interface and adding anoter one anyway? History plus a desire to keep the common case to one line. > Part of my idea (not implemented in this piece of code) was to use > ifconfig_if (or ifconfig_if_option) for interface options only and use > ipv4_ and ipv6_ifconfig_if to configure the ipaddr. of the interface. > This would make no difference between adding the first ipaddr and adding > more. Just for the record ;-). The other issue is that ifconfig__* lines have traditionally been valid ifconfig commands and this is not. Hmm, now that I think about it more, that's argues against having ifconfig in the name at all. Looking at the ipv6 variables, I see where you got ipv4_ifconfig_fxp0, but maybe the answer is to name this new code's variables something like ipv4__addrs. This empahsises both the fact this this is an address list, not an alias list, and that this is not valid ifconfig input. Similar code could presumably be written for ipv6. > > The ipv4_ifconfig_getargs function is slightly bogus as > > written since a default value makes no sense and that would be the wrong > > one anyway. The implemenation also fails to match the comment though > > that's easy to fix. I'd also not modify etc/rc.d/netif and do this from > > ifalias_up(). =20 >=20 > I moved everything to ifalias_up() keeping the other aliasN stuff. Now that I'm thinking about this as an address list, I'm thinking ifalias_up wasn't the place after all. Instead, ifalias_up should remain in network.subr, but be called via a new ipv4_up() function that would also do this new processing. > > Corresponding ifalias_down() support should also be added. >=20 > Done. Since there's a one word difference between the two cases, I think an ipv4_addrs_common function taking an add or delete argument and the interface would be appropriate to avoid duplication of this code. Also, if you could find a way to rewrite the loop so ifconfig is only called in one place, that would be a bit cleaner. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFDVFVgXY6L6fI4GtQRAmCRAKDTBLOfc4aMwmPMW0WvA2FG5OnYxgCeINMM Urt3+dH0nWo1S1FrfyP5N4I= =3wH0 -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs-- From owner-freebsd-rc@FreeBSD.ORG Tue Oct 18 14:10:39 2005 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 590CC16A41F for ; Tue, 18 Oct 2005 14:10:39 +0000 (GMT) (envelope-from cryx-freebsd@h3q.com) Received: from mail.h3q.com (mail.h3q.com [217.13.206.148]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8351D43D46 for ; Tue, 18 Oct 2005 14:10:37 +0000 (GMT) (envelope-from cryx-freebsd@h3q.com) Received: (qmail 18264 invoked from network); 18 Oct 2005 14:09:56 -0000 Received: from unknown (HELO ?192.168.23.34?) (cryx@85.178.78.60) by mail.h3q.com with AES256-SHA encrypted SMTP; 18 Oct 2005 14:09:56 -0000 Message-ID: <43550260.9050206@h3q.com> Date: Tue, 18 Oct 2005 16:10:40 +0200 From: Philipp Wuensche User-Agent: Mozilla Thunderbird 1.0.7 (Macintosh/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Brooks Davis References: <435412F7.2030906@h3q.com> <20051017215309.GH15097@odin.ac.hmc.edu> <435443DE.6090300@h3q.com> <20051018015233.GA20157@odin.ac.hmc.edu> In-Reply-To: <20051018015233.GA20157@odin.ac.hmc.edu> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: alias configuration in rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2005 14:10:39 -0000 Brooks Davis wrote: > Similar code could presumably be written for ipv6. The range feature will be a bit more complicated but yes. >>>Corresponding ifalias_down() support should also be added. >> >>Done. > > Since there's a one word difference between the two cases, I think > an ipv4_addrs_common function taking an add or delete argument and the > interface would be appropriate to avoid duplication of this code. > Also, if you could find a way to rewrite the loop so ifconfig is only > called in one place, that would be a bit cleaner. You're right, I removed the code duplication by implementing a ipv4_addr_common function, getting the interface and an action as argument and giving back a list of cidr-ipaddr. directly usable with ifconfig. ipv4_addr_common is called by ipv4_up() and ipv4_down() which also use ifconfig_if() and ifalias_if(), appending the alias or -alias arguement used by ifconfig and finally executing ifconfig. ipv4_up() and ipv4_down() could be called by etc/rc.d/netif, removing ifconfig_if() and ifalias_if(). To test the code easier, I put my implementation in a shell script: http://outpost.h3q.com/patches/ipv4-ifconfig.sh greetings, cryx From owner-freebsd-rc@FreeBSD.ORG Tue Oct 18 18:17:02 2005 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 39BF716A41F for ; Tue, 18 Oct 2005 18:17:02 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3ACE43D46 for ; Tue, 18 Oct 2005 18:17:01 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id j9IIGw7C020889; Tue, 18 Oct 2005 11:16:58 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j9IIGwDo020888; Tue, 18 Oct 2005 11:16:58 -0700 Date: Tue, 18 Oct 2005 11:16:58 -0700 From: Brooks Davis To: Philipp Wuensche Message-ID: <20051018181658.GD9748@odin.ac.hmc.edu> References: <435412F7.2030906@h3q.com> <20051017215309.GH15097@odin.ac.hmc.edu> <435443DE.6090300@h3q.com> <20051018015233.GA20157@odin.ac.hmc.edu> <43550260.9050206@h3q.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NklN7DEeGtkPCoo3" Content-Disposition: inline In-Reply-To: <43550260.9050206@h3q.com> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu Cc: freebsd-rc@freebsd.org Subject: Re: alias configuration in rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2005 18:17:02 -0000 --NklN7DEeGtkPCoo3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 18, 2005 at 04:10:40PM +0200, Philipp Wuensche wrote: > Brooks Davis wrote: >=20 > > Similar code could presumably be written for ipv6. >=20 > The range feature will be a bit more complicated but yes. >=20 > >>>Corresponding ifalias_down() support should also be added. > >> > >>Done. > >=20 > > Since there's a one word difference between the two cases, I think > > an ipv4_addrs_common function taking an add or delete argument and the > > interface would be appropriate to avoid duplication of this code. > > Also, if you could find a way to rewrite the loop so ifconfig is only > > called in one place, that would be a bit cleaner. >=20 > You're right, I removed the code duplication by implementing a > ipv4_addr_common function, getting the interface and an action as > argument and giving back a list of cidr-ipaddr. directly usable with > ifconfig. >=20 > ipv4_addr_common is called by ipv4_up() and ipv4_down() which also use > ifconfig_if() and ifalias_if(), appending the alias or -alias arguement > used by ifconfig and finally executing ifconfig. > > ipv4_up() and ipv4_down() could be called by etc/rc.d/netif, removing > ifconfig_if() and ifalias_if(). I think I'd have ipv4_addr_common do the ifconfig calls directly to keep ifv4_up short. I'd also keep ifconfig_up/down in netif so it's easy to disable ipv4 configuration without touching ifconfig_if. It will be a while yet before anyone seriously wants non-v4 systems, but that day is coming. Otherwise, I'm happy with this. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --NklN7DEeGtkPCoo3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFDVTwZXY6L6fI4GtQRAit/AJ4g9C67yFDp6KTAdcIgUI6XjL7rYgCgzjQo guMJKh2EPlkGOVgjAK+4RPo= =rm5F -----END PGP SIGNATURE----- --NklN7DEeGtkPCoo3-- From owner-freebsd-rc@FreeBSD.ORG Wed Oct 19 02:51:24 2005 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8561116A420 for ; Wed, 19 Oct 2005 02:51:24 +0000 (GMT) (envelope-from cryx-freebsd@h3q.com) Received: from mail.h3q.com (mail.h3q.com [217.13.206.148]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC9E843D49 for ; Wed, 19 Oct 2005 02:51:22 +0000 (GMT) (envelope-from cryx-freebsd@h3q.com) Received: (qmail 8669 invoked from network); 19 Oct 2005 02:50:39 -0000 Received: from unknown (HELO ?192.168.23.34?) (cryx@85.178.122.15) by mail.h3q.com with AES256-SHA encrypted SMTP; 19 Oct 2005 02:50:39 -0000 Message-ID: <4355B4AD.20001@h3q.com> Date: Wed, 19 Oct 2005 04:51:25 +0200 From: Philipp Wuensche User-Agent: Mozilla Thunderbird 1.0.7 (Macintosh/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Brooks Davis References: <435412F7.2030906@h3q.com> <20051017215309.GH15097@odin.ac.hmc.edu> In-Reply-To: <20051017215309.GH15097@odin.ac.hmc.edu> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: alias configuration in rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2005 02:51:24 -0000 Brooks Davis wrote: > > Finally modifications will be needed to rc.conf(5). Here is what I made up for rc.conf(5): One can configure more than one IP address with the ipv4__addr variable. One or more IP addresses must be provided in Classless Inter-Domain Routing (CIDR) address notation, whose last byte can be a range like 192.168.0.5-23/24. In this case the address 192.168.0.5 will be configured with the netmask /24 and the addresses 192.168.0.6 to 192.168.0.23 with the netmask /32. With the interface in question being ed0, an example could look like: ipv4_ed0_addr="127.0.0.1/24 127.0.1.1-5/28" Patch can be found at http://outpost.h3q.com/patches/rc.conf.5.patch greetings, cryx From owner-freebsd-rc@FreeBSD.ORG Wed Oct 19 03:10:12 2005 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 214B616A41F for ; Wed, 19 Oct 2005 03:10:12 +0000 (GMT) (envelope-from cryx-freebsd@h3q.com) Received: from mail.h3q.com (mail.h3q.com [217.13.206.148]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB37B43D4C for ; Wed, 19 Oct 2005 03:10:10 +0000 (GMT) (envelope-from cryx-freebsd@h3q.com) Received: (qmail 15243 invoked from network); 19 Oct 2005 03:09:22 -0000 Received: from unknown (HELO ?192.168.23.34?) (cryx@85.178.122.15) by mail.h3q.com with AES256-SHA encrypted SMTP; 19 Oct 2005 03:09:22 -0000 Message-ID: <4355B90F.6030002@h3q.com> Date: Wed, 19 Oct 2005 05:10:07 +0200 From: Philipp Wuensche User-Agent: Mozilla Thunderbird 1.0.7 (Macintosh/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Brooks Davis References: <435412F7.2030906@h3q.com> <20051017215309.GH15097@odin.ac.hmc.edu> <435443DE.6090300@h3q.com> <20051018015233.GA20157@odin.ac.hmc.edu> <43550260.9050206@h3q.com> <20051018181658.GD9748@odin.ac.hmc.edu> In-Reply-To: <20051018181658.GD9748@odin.ac.hmc.edu> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: alias configuration in rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2005 03:10:12 -0000 Brooks Davis wrote: > > I think I'd have ipv4_addr_common do the ifconfig calls directly to keep > ifv4_up short. I'd also keep ifconfig_up/down in netif so it's easy to > disable ipv4 configuration without touching ifconfig_if. It will be a > while yet before anyone seriously wants non-v4 systems, but that day is > coming. Another one: http://outpost.h3q.com/patches/network.subr.patch > Otherwise, I'm happy with this. :-) greetings, cryx From owner-freebsd-rc@FreeBSD.ORG Wed Oct 19 16:50:18 2005 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 36EEE16A41F for ; Wed, 19 Oct 2005 16:50:18 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5847C43D4C for ; Wed, 19 Oct 2005 16:50:17 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id j9JGoGnR025372; Wed, 19 Oct 2005 09:50:16 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j9JGoG13025370; Wed, 19 Oct 2005 09:50:16 -0700 Date: Wed, 19 Oct 2005 09:50:16 -0700 From: Brooks Davis To: Philipp Wuensche Message-ID: <20051019165016.GB20830@odin.ac.hmc.edu> References: <435412F7.2030906@h3q.com> <20051017215309.GH15097@odin.ac.hmc.edu> <4355B4AD.20001@h3q.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yEPQxsgoJgBvi8ip" Content-Disposition: inline In-Reply-To: <4355B4AD.20001@h3q.com> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu Cc: freebsd-rc@freebsd.org Subject: Re: alias configuration in rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2005 16:50:18 -0000 --yEPQxsgoJgBvi8ip Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 19, 2005 at 04:51:25AM +0200, Philipp Wuensche wrote: > Brooks Davis wrote: > > > > Finally modifications will be needed to rc.conf(5). >=20 > Here is what I made up for rc.conf(5): >=20 > One can configure more than one IP address with the > ipv4__addr variable. One or more IP addresses must > be provided in Classless Inter-Domain Routing (CIDR) address > notation, whose last byte can be a range like > 192.168.0.5-23/24. In this case the address 192.168.0.5 will > be configured with the netmask /24 and the addresses > 192.168.0.6 to 192.168.0.23 with the netmask /32. With the > interface in question being ed0, an example could look like: >=20 > ipv4_ed0_addr=3D"127.0.0.1/24 127.0.1.1-5/28" An example that is likely to actually work would probably go good (not using 127.0.0.1), but otherwise this seems fine. The patch to etc/network.subr looks good as well. The next step seems to be rolling up the full patch. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --yEPQxsgoJgBvi8ip Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFDVnlHXY6L6fI4GtQRArYiAJ0ROrLtSjq0UWWyXZ2zgdxRbMKhhwCfWLv4 ITWJFUFMqSvRxA+8/iD+ulk= =1MEP -----END PGP SIGNATURE----- --yEPQxsgoJgBvi8ip-- From owner-freebsd-rc@FreeBSD.ORG Wed Oct 19 22:07:11 2005 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2662E16A41F for ; Wed, 19 Oct 2005 22:07:11 +0000 (GMT) (envelope-from cryx-freebsd@h3q.com) Received: from mail.h3q.com (mail.h3q.com [217.13.206.148]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F93743D5A for ; Wed, 19 Oct 2005 22:07:09 +0000 (GMT) (envelope-from cryx-freebsd@h3q.com) Received: (qmail 33076 invoked from network); 19 Oct 2005 22:06:24 -0000 Received: from unknown (HELO ?192.168.23.34?) (cryx@85.178.95.249) by mail.h3q.com with AES256-SHA encrypted SMTP; 19 Oct 2005 22:06:24 -0000 Message-ID: <4356C390.5020402@h3q.com> Date: Thu, 20 Oct 2005 00:07:12 +0200 From: Philipp Wuensche User-Agent: Mozilla Thunderbird 1.0.7 (Macintosh/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Brooks Davis References: <435412F7.2030906@h3q.com> <20051017215309.GH15097@odin.ac.hmc.edu> <4355B4AD.20001@h3q.com> <20051019165016.GB20830@odin.ac.hmc.edu> In-Reply-To: <20051019165016.GB20830@odin.ac.hmc.edu> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: alias configuration in rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2005 22:07:11 -0000 Brooks Davis wrote: > The next step seems to be rolling up the full patch. Here is the patch including all my changes made to src/etc/network.subr src/etc/rc.d/netif and src/share/man/man5/rc.conf.5 http://outpost.h3q.com/patches/network.subr.patch greetings, cryx From owner-freebsd-rc@FreeBSD.ORG Thu Oct 20 17:30:21 2005 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 110F816A420 for ; Thu, 20 Oct 2005 17:30:21 +0000 (GMT) (envelope-from erdgeist@erdgeist.org) Received: from elektropost.org (elektropost.org [80.237.196.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 87E0743D75 for ; Thu, 20 Oct 2005 17:30:18 +0000 (GMT) (envelope-from erdgeist@erdgeist.org) Received: (qmail 14675 invoked by uid 0); 20 Oct 2005 17:29:45 -0000 Received: from fnord.cryptophone.de (HELO ?10.1.1.71?) (erdgeist@erdgeist.org@212.42.235.100) by elektropost.org with AES256-SHA encrypted SMTP; 20 Oct 2005 17:29:45 -0000 Message-ID: <4357D422.2000200@erdgeist.org> Date: Thu, 20 Oct 2005 19:30:10 +0200 From: Dirk Engling User-Agent: Mozilla Thunderbird 1.0 (Macintosh/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-rc@freebsd.org X-Enigmail-Version: 0.89.6.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: defunc: /etc/rc.d/jail restart X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2005 17:30:21 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The /etc/rc.d/jail script does nothing when its restart subcommand is called. This is due to these lines: ##### in /etc/rc.d/jail, line 246ff cmd="$1" if [ $# -gt 0 ]; then ~ shift fi [ -n "$*" ] && jail_list="$*" run_rc_command "${cmd}" ##### in /etc/rc.subr, line 773f ( $0 ${_rc_prefix}stop $rc_extra_args ) $0 ${_rc_prefix}start $rc_extra_args ##### in /etc/defaults/rc.conf, line 513 jail_list="" # Space separated list of names of jails So /etc/rc.d/jail throws away the parameters after saving its value in $jail_list. It calls /etc/rc.subr which, for the restart command, then calls /etc/rc.d/jail stop and /etc/rc.d/jail start, which both in turn source /etc/defaults/rc.conf, which again clears $jail_list. My suggestion would be to let /etc/defaults/* just do the job it is being meant for: providing defaults. This would lead to the following diff. - --- rc.conf Thu Oct 20 19:25:13 2005 +++ rc.conf_old Thu Oct 20 19:24:16 2005 @@ -510,7 +510,7 @@ ~ ### Jail Configuration ####################################### ~ ############################################################## ~ jail_enable="NO" # Set to NO to disable starting of any jails - -jail_list=${jail_list:-""} # Space separated list of names of jails +jail_list="" # Space separated list of names of jails ~ jail_set_hostname_allow="YES" # Allow root user in a jail to change its hostname ~ jail_socket_unixiproute_only="YES" # Route only TCP/IP within a jail ~ jail_sysvipc_allow="NO" # Allow SystemV IPC use from within a jail However, theres lots of variables that should not be reset if already set, I might want to call /etc/rc.d/jail having set up some variables (including jail_list) myself (which in fact I tried in another project). Are there any situation, where accepting variables from environment of caller can be harmful? Regards ~ Dirk Engling -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (Darwin) iD8DBQFDV9QiImmQdUyYEgkRAm9MAKCOYcJOBj8hQFGcdgGJ/lwRkQnRhACeNjVt Edbt/WyJy/NtcOEHuS+L4cc= =jjHt -----END PGP SIGNATURE----- From owner-freebsd-rc@FreeBSD.ORG Thu Oct 20 19:39:32 2005 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5A47816A41F for ; Thu, 20 Oct 2005 19:39:32 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (comp.chem.msu.su [158.250.32.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6219643D5A for ; Thu, 20 Oct 2005 19:39:29 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.13.3/8.13.3) with ESMTP id j9KJdJAk070773; Thu, 20 Oct 2005 23:39:19 +0400 (MSD) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.13.3/8.13.3/Submit) id j9KJdI2N070771; Thu, 20 Oct 2005 23:39:18 +0400 (MSD) (envelope-from yar) Date: Thu, 20 Oct 2005 23:39:18 +0400 From: Yar Tikhiy To: Dirk Engling Message-ID: <20051020193918.GB69814@comp.chem.msu.su> References: <4357D422.2000200@erdgeist.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4357D422.2000200@erdgeist.org> User-Agent: Mutt/1.5.9i Cc: freebsd-rc@freebsd.org Subject: Re: defunc: /etc/rc.d/jail restart X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2005 19:39:32 -0000 On Thu, Oct 20, 2005 at 07:30:10PM +0200, Dirk Engling wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > The /etc/rc.d/jail script does nothing when its restart subcommand is > called. > > This is due to these lines: > > ##### in /etc/rc.d/jail, line 246ff > > cmd="$1" > if [ $# -gt 0 ]; then > ~ shift > fi > [ -n "$*" ] && jail_list="$*" > run_rc_command "${cmd}" > > ##### in /etc/rc.subr, line 773f > > ( $0 ${_rc_prefix}stop $rc_extra_args ) > $0 ${_rc_prefix}start $rc_extra_args IMHO the source of the problem is these two lines. I think they should be replaced by calls to run_rc_command so that the configuration is read only once by load_rc_config in the first (and the only) instance of the script. > ##### in /etc/defaults/rc.conf, line 513 > > jail_list="" # Space separated list of names of jails > > > > > So /etc/rc.d/jail throws away the parameters after saving its value in > $jail_list. It calls /etc/rc.subr which, for the restart command, then > calls /etc/rc.d/jail stop and /etc/rc.d/jail start, which both in turn > source /etc/defaults/rc.conf, which again clears $jail_list. > > My suggestion would be to let /etc/defaults/* just do the job it is > being meant for: providing defaults. This would lead to the following diff. > > > - --- rc.conf Thu Oct 20 19:25:13 2005 > +++ rc.conf_old Thu Oct 20 19:24:16 2005 > @@ -510,7 +510,7 @@ > ~ ### Jail Configuration ####################################### > ~ ############################################################## > ~ jail_enable="NO" # Set to NO to disable starting of any jails > - -jail_list=${jail_list:-""} # Space separated list of names of jails > +jail_list="" # Space separated list of names of jails > ~ jail_set_hostname_allow="YES" # Allow root user in a jail to change its > hostname > ~ jail_socket_unixiproute_only="YES" # Route only TCP/IP within a jail > ~ jail_sysvipc_allow="NO" # Allow SystemV IPC use from within a jail > > > However, theres lots of variables that should not be reset if already > set, I might want to call /etc/rc.d/jail having set up some variables > (including jail_list) myself (which in fact I tried in another project). > > Are there any situation, where accepting variables from environment of > caller can be harmful? > > Regards > > ~ Dirk Engling > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.6 (Darwin) > > iD8DBQFDV9QiImmQdUyYEgkRAm9MAKCOYcJOBj8hQFGcdgGJ/lwRkQnRhACeNjVt > Edbt/WyJy/NtcOEHuS+L4cc= > =jjHt > -----END PGP SIGNATURE----- > _______________________________________________ > freebsd-rc@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-rc > To unsubscribe, send any mail to "freebsd-rc-unsubscribe@freebsd.org" -- Yar