From andrew@ugh.net.au  Fri Jan  3 23:35:07 2003
Return-Path: <andrew@ugh.net.au>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A1C6A37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  3 Jan 2003 23:35:07 -0800 (PST)
Received: from starbug.ugh.net.au (starbug.ugh.net.au [203.31.238.37])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B7F0A43ED4
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  3 Jan 2003 23:35:06 -0800 (PST)
	(envelope-from andrew@ugh.net.au)
Received: by starbug.ugh.net.au (Postfix, from userid 1000)
	id 8D673A818; Sat,  4 Jan 2003 18:35:02 +1100 (EST)
Message-Id: <20030104073502.8D673A818@starbug.ugh.net.au>
Date: Sat,  4 Jan 2003 18:35:02 +1100 (EST)
From: Andrew <andrew@ugh.net.au>
Reply-To: Andrew <andrew@ugh.net.au>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: No way to set link addresses through rc.conf
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         46746
>Category:       conf
>Synopsis:       No way to set link addresses through rc.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          suspended
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 03 23:40:01 PST 2003
>Closed-Date:    
>Last-Modified:  Wed Jun 16 07:06:20 GMT 2004
>Originator:     Andrew
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
UgH!
>Environment:
System: FreeBSD starbug.ugh.net.au 4.7-STABLE FreeBSD 4.7-STABLE #9: Sun Oct 27 22:46:03 EST 2002     andrew@starbug.ugh.net.au:/usr/obj/usr/src/sys/STARBUG  i386

>Description:

There is no easy way to set both the link and inet addresses of an interface.
There seems to be special support for ipx already - I have just extended this
to all address families (and removed the specific ipx support).

>How-To-Repeat:
	
>Fix:

/etc/defaults/rc.conf:

--- rc.conf.orig	Sat Jan  4 13:09:24 2003
+++ rc.conf	Sat Jan  4 13:37:17 2003
@@ -86,6 +86,7 @@
 network_interfaces="auto"	# List of network interfaces (or "auto").
 cloned_interfaces=""		# List of cloned network interfaces to create.
 #cloned_interfaces="gif0 gif1 gif2 gif3" # Pre-cloning GENERIC config.
+network_families="inet inet6 atalk ipx link"
 ifconfig_lo0="inet 127.0.0.1"	# default loopback device configuration.
 #ifconfig_lo0_alias0="inet 127.0.0.254 netmask 0xffffffff" # Sample alias entry.
 #ifconfig_ed0_ipx="ipx 0x00010010"	# Sample IPX address family entry.

/etc/rc.network:

--- rc.network.orig	Sat Jan  4 13:03:32 2003
+++ rc.network	Sat Jan  4 18:45:58 2003
@@ -221,6 +221,17 @@
 		${dhcp_program:-/sbin/dhclient} ${dhcp_flags} ${dhcp_interfaces}
 	fi
 
+	# configure interfaces for other address families
+	for family in ${network_families}; do
+		for ifn in ${network_interfaces}; do
+			eval ifconfig_args=\$ifconfig_${ifn}_${family}
+			if [ -n "${ifconfig_args}" ]; then
+				ifconfig ${ifn} ${ifconfig_args}
+				eval showstat_$ifn=1
+			fi
+		done
+	done
+
 	for ifn in ${network_interfaces}; do
 		# Check to see if aliases need to be added
 		#
@@ -235,14 +246,6 @@
 				break;
 			fi
 		done
-
-		# Do ipx address if specified
-		#
-		eval ifconfig_args=\$ifconfig_${ifn}_ipx
-		if [ -n "${ifconfig_args}" ]; then
-			ifconfig ${ifn} ${ifconfig_args}
-			eval showstat_$ifn=1
-		fi
 	done
 
 	for ifn in ${network_interfaces}; do
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->bms 
Responsible-Changed-By: bms 
Responsible-Changed-When: Tue 25 Nov 2003 08:25:09 PST 
Responsible-Changed-Why:  
I'm in hoover up network PRs mode. I'll look into this. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=46746 
State-Changed-From-To: open->analyzed 
State-Changed-By: bms 
State-Changed-When: Thu 27 Nov 2003 02:15:23 PST 
State-Changed-Why:  
The plan right now is to handle this in an ifconfig(8). 

Curious as to how submitter has this working with aliases, however, as 
I haven't tested this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=46746 
State-Changed-From-To: analyzed->suspended 
State-Changed-By: bms 
State-Changed-When: Wed Jun 16 07:05:27 GMT 2004 
State-Changed-Why:  
No interest in fixing - patches not applicable to upcoming 5.3 


Responsible-Changed-From-To: bms->freebsd-bugs 
Responsible-Changed-By: bms 
Responsible-Changed-When: Wed Jun 16 07:05:27 GMT 2004 
Responsible-Changed-Why:  
Orphaning this, no real interest/demand here for it. someone else 
can pick it up. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=46746 
>Unformatted:
