From gshapiro@gshapiro.net  Fri Oct 19 00:11:43 2001
Return-Path: <gshapiro@gshapiro.net>
Received: from horsey.gshapiro.net (horsey.gshapiro.net [209.220.147.178])
	by hub.freebsd.org (Postfix) with ESMTP id 807C237B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 19 Oct 2001 00:11:42 -0700 (PDT)
Received: from horsey.gshapiro.net (gshapiro@localhost [IPv6:::1])
	by horsey.gshapiro.net (8.12.1/8.12.1) with ESMTP id f9J7BfNM028307
	(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO);
	Fri, 19 Oct 2001 00:11:41 -0700 (PDT)
Received: (from gshapiro@localhost)
	by horsey.gshapiro.net (8.12.1/8.12.1/Submit) id f9J7BfIe028306;
	Fri, 19 Oct 2001 00:11:41 -0700 (PDT)
Message-Id: <200110190711.f9J7BfIe028306@horsey.gshapiro.net>
Date: Fri, 19 Oct 2001 00:11:41 -0700 (PDT)
From: Gregory Neil Shapiro <gshapiro+freebsd-gnats@gshapiro.net>
To: FreeBSD-gnats-submit@freebsd.org
Subject: rc.network6: Order of operations for ipv6_ifconfig_X_alias# wrong
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         31366
>Category:       conf
>Synopsis:       rc.network6: Order of operations for ipv6_ifconfig_X_alias# wrong
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    ume
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 19 00:20:00 PDT 2001
>Closed-Date:    Tue Nov 20 04:54:37 PST 2001
>Last-Modified:  Tue Nov 20 04:55:23 PST 2001
>Originator:     Gregory Neil Shapiro
>Release:        FreeBSD 4.4-STABLE i386
>Organization:
>Environment:
System: FreeBSD horsey.gshapiro.net 4.4-STABLE FreeBSD 4.4-STABLE #13: Sun Oct 7 17:12:57 PDT 2001 gshapiro@horsey.gshapiro.net:/home/FreeBSD/RELENG_4/obj/sys/HORSEY i386

>Description:

In order to use IPv6 autoconfiguration (i.e., rtsol) as well as additional
IPv6 addresses for an interface (for virtual hosting), I put the following
in /etc/rc.conf:

ipv6_enable="YES"
ipv6_ifconfig_fxp0_alias0="3ffe:0507:018b:0001:d1dc:f7bc:0000:0001"

Since there is no "ipv6_ifconfig_fxp0" setting, the interface will be
autoconfigured.  However, /etc/rc.network6 (in network6_interface_setup())
adds alias entries before calling rtsol.  rtsol doesn't autoconfigure
the the interface address if it already has one.

>How-To-Repeat:

>Fix:

I believe the rtsol must be done before the alias processing.  I've tested
this in my setup and it works.

Index: etc/rc.network6
===================================================================
RCS file: /src/FreeBSD/cvsrepo/src/etc/rc.network6,v
retrieving revision 1.5.2.18
diff -u -r1.5.2.18 rc.network6
--- etc/rc.network6	2001/07/27 20:37:53	1.5.2.18
+++ etc/rc.network6	2001/10/19 07:04:46
@@ -289,15 +289,6 @@
 			rtsol_interface=no
 			ifconfig $i inet6 ${ipv6_ifconfig} alias
 		fi
-		alias=0
-		while : ; do
-			eval ipv6_ifconfig=\$ipv6_ifconfig_${i}_alias${alias}
-			if [ -z "${ipv6_ifconfig}" ]; then
-				break;
-			fi
-			ifconfig $i inet6 ${ipv6_ifconfig} alias
-			alias=$((${alias} + 1))
-		done
 
 		if [ ${rtsol_available} = yes -a ${rtsol_interface} = yes ]
 		then
@@ -323,6 +314,19 @@
 		ifconfig $1 up
 		rtsol $1
 	fi
+
+	for i in $interfaces; do
+		alias=0
+		while : ; do
+			eval ipv6_ifconfig=\$ipv6_ifconfig_${i}_alias${alias}
+			if [ -z "${ipv6_ifconfig}" ]; then
+				break;
+			fi
+			ifconfig $i inet6 ${ipv6_ifconfig} alias
+			alias=$((${alias} + 1))
+		done
+	done
+
 }
 
 network6_stf_setup() {
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->ume 
Responsible-Changed-By: gshapiro 
Responsible-Changed-When: Mon Nov 19 19:54:32 PST 2001 
Responsible-Changed-Why:  
This appears to be the person who manages rc.network6.  If not, let me know 
and I'll look at committing the patch myself. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=31366 
State-Changed-From-To: open->closed 
State-Changed-By: ume 
State-Changed-When: Tue Nov 20 04:54:37 PST 2001 
State-Changed-Why:  
Thanks!  I just committed it. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=31366 
>Unformatted:
