From lumpy@the.whole.net  Mon Jan 28 15:53:22 2002
Return-Path: <lumpy@the.whole.net>
Received: from the.whole.net (the.whole.net [206.26.15.65])
	by hub.freebsd.org (Postfix) with ESMTP id 6A18237B402
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 28 Jan 2002 15:53:21 -0800 (PST)
Received: (from lumpy@localhost)
	by the.whole.net (8.11.6/8.11.0) id g0SNrKC07661;
	Mon, 28 Jan 2002 18:53:20 -0500 (EST)
Message-Id: <200201282353.g0SNrKC07661@the.whole.net>
Date: Mon, 28 Jan 2002 18:53:20 -0500 (EST)
From: The Lumpy One <lumpy@the.whole.net>
Reply-To: The Lumpy One <lumpy@the.whole.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: rc.network patch to allow ifconfig aliases to change without renumbering them all
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         34392
>Category:       conf
>Synopsis:       rc.network patch to allow ifconfig aliases to change without renumbering them all
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 28 16:00:00 PST 2002
>Closed-Date:    Tue Jan 29 02:51:15 PST 2002
>Last-Modified:  Tue Jan 29 02:52:24 PST 2002
>Originator:     The Lumpy One
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
The Whole Net
>Environment:
System: FreeBSD the.whole.net 4.3-STABLE FreeBSD 4.3-STABLE #0: Thu Jul 26 00:13:32 EDT 2001 root@the.whole.net:/usr/obj/usr/src/sys/THE-20010726 i386
>Description:
	It seems silly that you have to renumber the ifconfig aliases in
	/etc/rc.conf when you remove one -- because they are number based
	and count up sequentially.
>How-To-Repeat:
	The manpage for rc.conf describes this functionality and the
	script chunk replaced by this patch will clearly function this 
	way.
>Fix:

225,235c225,228
<                 alias=0
<                 while : ; do
<                         eval ifconfig_args=\$ifconfig_${ifn}_alias${alias}
<                         if [ -n "${ifconfig_args}" ]; then
<                                 ifconfig ${ifn} ${ifconfig_args} alias
<                                 eval showstat_$ifn=1
<                                 alias=$((${alias} + 1))
<                         else
<                                 break;
<                         fi
<                 done
---
> 		for alias in `set|awk -F= '(/^ifconfig_'${ifn}'_alias/){print $2};'`; do
> 			eval showstat_$ifn=1
> 			ifconfig ${ifn} ${x} alias
> 		done
>Release-Note:
>Audit-Trail:

From: Ian Dowse <iedowse@maths.tcd.ie>
To: The Lumpy One <lumpy@the.whole.net>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: conf/34392: rc.network patch to allow ifconfig aliases to change without renumbering them all 
Date: Tue, 29 Jan 2002 01:40:59 +0000

 In message <200201282353.g0SNrKC07661@the.whole.net>, The Lumpy One writes:
 >
 >	The manpage for rc.conf describes this functionality and the
 >	script chunk replaced by this patch will clearly function this 
 >	way.
 
 >> 		for alias in `set|awk -F= '(/^ifconfig_'${ifn}'_alias/){print $
 
 This can't be used, becaues awk is in /usr/bin, and /usr may not
 be available at this time (e.g. on diskless systems with an NFS
 /usr).
 
 But see conf/21695:
 
 	http://www.FreeBSD.org/cgi/query-pr.cgi?pr=21695
 
 It describes exactly the same problem, and I proposed a version of
 your idea that avoids the use of awk by using sh builtins only.
 
 Ian

From: lumpy <lumpy@the.whole.net>
To: Ian Dowse <iedowse@maths.tcd.ie>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: conf/34392: rc.network patch to allow ifconfig aliases to change
 without renumbering them all 
Date: Mon, 28 Jan 2002 21:01:12 -0500 (EST)

 Very cool -- hope it gets in soon :)
 
 
 
 On Tue, 29 Jan 2002, Ian Dowse wrote:
 
 > In message <200201282353.g0SNrKC07661@the.whole.net>, The Lumpy One writes:
 > >
 > >	The manpage for rc.conf describes this functionality and the
 > >	script chunk replaced by this patch will clearly function this
 > >	way.
 >
 > >> 		for alias in `set|awk -F= '(/^ifconfig_'${ifn}'_alias/){print $
 >
 > This can't be used, becaues awk is in /usr/bin, and /usr may not
 > be available at this time (e.g. on diskless systems with an NFS
 > /usr).
 >
 > But see conf/21695:
 >
 > 	http://www.FreeBSD.org/cgi/query-pr.cgi?pr=21695
 >
 > It describes exactly the same problem, and I proposed a version of
 > your idea that avoids the use of awk by using sh builtins only.
 >
 > Ian
 >
 
State-Changed-From-To: open->closed 
State-Changed-By: cjc 
State-Changed-When: Tue Jan 29 02:51:15 PST 2002 
State-Changed-Why:  
Duplicate of conf/21695. 

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