conf/119076: [patch] /etc/rc.d/netif tries to remove alias addresses two times from interfaces

Jaakko Heinonen jh at saunalahti.fi
Thu Dec 27 12:30:02 PST 2007


>Number:         119076
>Category:       conf
>Synopsis:       [patch] /etc/rc.d/netif tries to remove alias addresses two times from interfaces
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 27 20:30:00 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     Jaakko Heinonen
>Release:        7.0-BETA4
>Organization:
>Environment:
FreeBSD x 7.0-BETA4 FreeBSD 7.0-BETA4 #0: Sun Dec  2 19:19:04 UTC 2007     root at logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
/etc/rc.d/netif runs first "ifconfig interface inet x.x.x.x delete" and then "ifconfig interface inet x.x.x.x -alias" for network interface aliases defined in /etc/rc.conf with ifconfig_<int>_aliasX syntax. The second attempt to remove an address results an error.
>How-To-Repeat:
/etc/rc.conf:
ifconfig_vr0="inet 10.0.0.3 netmask 255.0.0.0"
ifconfig_vr0_alias0="inet 10.0.0.4"

# /etc/rc.d/netif stop vr0
Stopping network:ifconfig: ioctl (SIOCDIFADDR): Can't assign requested address vr0.

(after applying the attached patch)
# /etc/rc.d/netif stop vr0
Stopping network: vr0.

>Fix:


Patch attached with submission follows:

--- ./network.subr.orig	Fri Jan 12 09:13:15 2007
+++ ./network.subr	Tue Dec 25 23:01:19 2007
@@ -284,6 +284,9 @@
 
 	ifexists ${_if} || return 1
 
+	ifalias_down ${_if} && _ret=0
+	ipv4_addrs_common ${_if} -alias && _ret=0
+
 	inetList="`ifconfig ${_if} | grep 'inet ' | tr "\n" "$_ifs"`"
 
 	oldifs="$IFS"
@@ -300,9 +303,6 @@
 		_ret=0
 	done
 	IFS="$oldifs"
-
-	ifalias_down ${_if} && _ret=0
-	ipv4_addrs_common ${_if} -alias && _ret=0
 
 	return $_ret
 }


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list