alias configuration in rc.conf

Brooks Davis brooks at one-eyed-alien.net
Tue Oct 18 11:17:02 PDT 2005


On Tue, Oct 18, 2005 at 04:10:40PM +0200, Philipp Wuensche wrote:
> 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().

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

-- 
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20051018/2f8e29b2/attachment.bin


More information about the freebsd-rc mailing list