Date: Tue, 18 Oct 2005 11:16:58 -0700 From: Brooks Davis <brooks@one-eyed-alien.net> To: Philipp Wuensche <cryx-freebsd@h3q.com> Cc: freebsd-rc@freebsd.org Subject: Re: alias configuration in rc.conf Message-ID: <20051018181658.GD9748@odin.ac.hmc.edu> In-Reply-To: <43550260.9050206@h3q.com> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051018181658.GD9748>