Subject: Re: rc.conf vs interface aliases
To: None <tech-net@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-net
Date: 01/18/2006 16:46:39
>> Of course, I could do the same here, but mucking about with the
>> supplied /etc/rc.d/* scripts is just asking for trouble at OS
>> upgrade time.
> it's actually not.  since you can add your modifications to
> /etc/rc.conf.d/network instead.

How would that work?  The description in rc.conf(5) does not make it
appear that it supports the sort of thing I'm after.

Here's the functionality I'm talking about, in the form of a patch to
3.0's /etc/rc.d/network, network,v 1.47.2.1.  (I may have details such
as the eval line wrong; this is an untested adaptation of the patch I
use with 1.4T.)  What should I put in /etc/rc.conf.d/network to get
such functionality?  It's not obvious to me in the least.

--- network=	2005-07-02 19:29:48.000000000 -0400
+++ network	2006-01-18 16:53:37.000000000 -0500
@@ -280,6 +280,16 @@
 				fi
 			done
 		fi
+		n=1
+		while :; do
+			eval args=\$ifalias_$int\_$n
+			if [ -n "$args" ]; then
+				ifconfig $int $args alias
+				n=$(($n+1))
+			else
+				break
+			fi
+		done
 	done
 
 	# /etc/ifaliases, if it exists, contains the names of additional IP

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B