Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Dec 2007 20:23:36 GMT
From:      Jaakko Heinonen <jh@saunalahti.fi>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   conf/119076: [patch] /etc/rc.d/netif tries to remove alias addresses two times from interfaces
Message-ID:  <200712272023.lBRKNa0h008833@www.freebsd.org>
Resent-Message-ID: <200712272030.lBRKU0eP082404@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712272023.lBRKNa0h008833>