Subject: Re: configuring clone interfaces before bridge at boot-time?
To: None <tech-net@netbsd.org>
From: Allen Briggs <briggs@netbsd.org>
List: tech-net
Date: 10/08/2006 23:14:25
On Sun, Oct 08, 2006 at 07:56:10PM -0400, Steven M. Bellovin wrote:
> [...]  I suspect that the right thing to do
> is to take this section of the config loop:
> 
>                        if [ -n "$args" ] || [ -f /etc/ifconfig.$int ]; then
>                                 if ifconfig $int create 2>/dev/null && \
>                                    checkyesno ipfilter; then
>                                         # resync ipf(4)
>                                         ipf -y >/dev/null
>                                 fi
>                         fi
> 
> and do it in a separate loop, before the rest of the config loop.  That way,
> all desired clone interfaces are created before any bridges are configured.

This seems like the right thing to do.

Something like (untested):

Index: network
===================================================================
RCS file: /cvsroot/src/etc/rc.d/network,v
retrieving revision 1.50
diff -p -u -r1.50 network
--- network	24 Nov 2005 17:28:45 -0000	1.50
+++ network	9 Oct 2006 03:13:15 -0000
@@ -200,6 +200,9 @@ network_start()
 					ipf -y >/dev/null
 				fi
 			fi
+		done
+		for int in $tmp; do
+			eval args=\$ifconfig_$int
 			if [ -n "$args" ]; then
 				echo -n " $int"
 				ifconfig $int $args

Seems like it would do the right thing.

-allen

-- 
Allen Briggs  |  http://www.ninthwonder.com/~briggs/  |  briggs@ninthwonder.com