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--