From nobody@FreeBSD.org  Sat Jan  5 13:16:45 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id 51818BAE
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  5 Jan 2013 13:16:45 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 2ED1CDB5
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  5 Jan 2013 13:16:45 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r05DGiMB040590
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 5 Jan 2013 13:16:44 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r05DGi30040589;
	Sat, 5 Jan 2013 13:16:44 GMT
	(envelope-from nobody)
Message-Id: <201301051316.r05DGi30040589@red.freebsd.org>
Date: Sat, 5 Jan 2013 13:16:44 GMT
From: Tatsuki Makino <tatsuki_makino@hotmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: /etc/rc.d/ip6addrctl exits not 0 when ip6addrctl_verbose="NO"
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         175006
>Category:       conf
>Synopsis:       /etc/rc.d/ip6addrctl exits not 0 when ip6addrctl_verbose="NO"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    hrs
>State:          patched
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 05 13:20:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Sat May 11 19:20:00 UTC 2013
>Originator:     Tatsuki Makino
>Release:        FreeBSD 9.1-PRERELEASE i386
>Organization:
>Environment:
FreeBSD T0.test 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0 r244396M: Tue Dec 18 23:49:46 UTC 2012     root@T0.test:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
The exit status of /etc/rc.d/ip6addrctl is not 0.
"checkyesno ip6addrctl_verbose" is affected it.
>How-To-Repeat:
% # on 9-stable and 8-stable
% su
# tcsh
# set printexitvalue
# echo 'ip6addrctl_verbose="NO"' >> /etc/rc.conf
# /etc/rc.d/ip6addrctl start
Exit 1
>Fix:
patch

Patch attached with submission follows:

Index: base/head/etc/rc.d/ip6addrctl
===================================================================
--- base/head/etc/rc.d/ip6addrctl	(revision 245056)
+++ base/head/etc/rc.d/ip6addrctl	(working copy)
@@ -35,6 +35,7 @@
 	ip6addrctl add ::/96		20	3
 	ip6addrctl add ::ffff:0:0/96	10	4
 	checkyesno ip6addrctl_verbose && ip6addrctl
+	return 0
 }
 
 ip6addrctl_prefer_ipv4()
@@ -48,6 +49,7 @@
 	ip6addrctl add 2002::/16	20	3
 	ip6addrctl add ::/96		10	4
 	checkyesno ip6addrctl_verbose && ip6addrctl
+	return 0
 }
 
 ip6addrctl_start()
@@ -60,7 +62,7 @@
 		if [ -r "${config_file}" -a -s "${config_file}" ]; then
 			ip6addrctl flush >/dev/null 2>&1
 			ip6addrctl install "${config_file}"
-			checkyesno ip6addrctl_verbose && ip6addrctl
+			checkyesno ip6addrctl_verbose && ip6addrctl || true
 		else
 			if checkyesno ipv6_activate_all_interfaces; then
 				ip6addrctl_prefer_ipv6


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->hrs 
Responsible-Changed-By: hrs 
Responsible-Changed-When: Sat Jan 5 15:58:44 UTC 2013 
Responsible-Changed-Why:  
I'll take this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=175006 
State-Changed-From-To: open->patched 
State-Changed-By: hrs 
State-Changed-When: Sat May 4 15:43:24 UTC 2013 
State-Changed-Why:  
Committed a fix to -CURRENT.  It will be merged into 9.x and 8.x eventually. 
Thank you for your report. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=175006 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: conf/175006: commit references a PR
Date: Sat,  4 May 2013 15:43:03 +0000 (UTC)

 Author: hrs
 Date: Sat May  4 15:42:55 2013
 New Revision: 250240
 URL: http://svnweb.freebsd.org/changeset/base/250240
 
 Log:
   - Fix exit status when ip6addrctl_verbose=yes [*]
   - Use the absolute pathname for ip6addrctl.
   - Use "install" instead of "add" to reduce the number of invocations.
   
   Reported by:	Tatsuki Makino [*]
   PR:		conf/175006 [*]
   MFC after:	1 week
 
 Modified:
   head/etc/rc.d/ip6addrctl
 
 Modified: head/etc/rc.d/ip6addrctl
 ==============================================================================
 --- head/etc/rc.d/ip6addrctl	Sat May  4 15:10:01 2013	(r250239)
 +++ head/etc/rc.d/ip6addrctl	Sat May  4 15:42:55 2013	(r250240)
 @@ -24,38 +24,42 @@ config_file="/etc/ip6addrctl.conf"
  set_rcvar_obsolete ipv6_enable ipv6_activate_all_interfaces
  set_rcvar_obsolete ipv6_prefer ip6addrctl_policy
  
 +IP6ADDRCTL_CMD="/usr/sbin/ip6addrctl"
 +
  ip6addrctl_prefer_ipv6()
  {
  	afexists inet6 || return 0
  
 -	ip6addrctl flush >/dev/null 2>&1
 -	ip6addrctl add ::1/128		 50	 0
 -	ip6addrctl add ::/0		 40	 1
 -	ip6addrctl add ::ffff:0:0/96	 35	 4
 -	ip6addrctl add 2002::/16	 30	 2
 -	ip6addrctl add 2001::/32	  5	 5
 -	ip6addrctl add fc00::/7		  3	13
 -	ip6addrctl add ::/96		  1	 3
 -	ip6addrctl add fec0::/10	  1	11
 -	ip6addrctl add 3ffe::/16	  1	12
 -	checkyesno ip6addrctl_verbose && ip6addrctl
 +	${IP6ADDRCTL_CMD} flush >/dev/null 2>&1
 +	cat <<EOT | ${IP6ADDRCTL_CMD} install /dev/stdin
 +	::1/128		 50	 0
 +	::/0		 40	 1
 +	::ffff:0:0/96	 35	 4
 +	2002::/16	 30	 2
 +	2001::/32	  5	 5
 +	fc00::/7	  3	13
 +	::/96		  1	 3
 +	fec0::/10	  1	11
 +	3ffe::/16	  1	12
 +EOT
  }
  
  ip6addrctl_prefer_ipv4()
  {
  	afexists inet6 || return 0
  
 -	ip6addrctl flush >/dev/null 2>&1
 -	ip6addrctl add ::1/128		 50	 0
 -	ip6addrctl add ::/0		 40	 1
 -	ip6addrctl add ::ffff:0:0/96	100	 4
 -	ip6addrctl add 2002::/16	 30	 2
 -	ip6addrctl add 2001::/32	  5	 5
 -	ip6addrctl add fc00::/7		  3	13
 -	ip6addrctl add ::/96		  1	 3
 -	ip6addrctl add fec0::/10	  1	11
 -	ip6addrctl add 3ffe::/16	  1	12
 -	checkyesno ip6addrctl_verbose && ip6addrctl
 +	${IP6ADDRCTL_CMD} flush >/dev/null 2>&1
 +	cat <<EOT | ${IP6ADDRCTL_CMD} install /dev/stdin
 +	::1/128		 50	 0
 +	::/0		 40	 1
 +	::ffff:0:0/96	100	 4
 +	2002::/16	 30	 2
 +	2001::/32	  5	 5
 +	fc00::/7	  3	13
 +	::/96		  1	 3
 +	fec0::/10	  1	11
 +	3ffe::/16	  1	12
 +EOT
  }
  
  ip6addrctl_start()
 @@ -66,9 +70,8 @@ ip6addrctl_start()
  	case "${ip6addrctl_policy}" in
  	[Aa][Uu][Tt][Oo])
  		if [ -r "${config_file}" -a -s "${config_file}" ]; then
 -			ip6addrctl flush >/dev/null 2>&1
 -			ip6addrctl install "${config_file}"
 -			checkyesno ip6addrctl_verbose && ip6addrctl
 +			${IP6ADDRCTL_CMD} flush >/dev/null 2>&1
 +			${IP6ADDRCTL_CMD} install "${config_file}"
  		else
  			if checkyesno ipv6_activate_all_interfaces; then
  				ip6addrctl_prefer_ipv6
 @@ -92,7 +95,7 @@ ip6addrctl_start()
  		ip6addrctl_prefer_ipv4
  	;;
  	[Nn][Oo][Nn][Ee])
 -		ip6addrctl flush >/dev/null 2>&1
 +		${IP6ADDRCTL_CMD} flush >/dev/null 2>&1
  	;;
  	*)
  		warn "\$ip6addrctl_policy is invalid: ${ip6addrctl_policy}. " \
 @@ -100,6 +103,11 @@ ip6addrctl_start()
  		ip6addrctl_prefer_ipv4
  	;;
  	esac
 +
 +	if checkyesno ip6addrctl_verbose; then
 +		echo 'Address selection policy table for IPv4 and IPv6:'
 +		${IP6ADDRCTL_CMD}
 +	fi
  }
  
  ip6addrctl_stop()
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: conf/175006: commit references a PR
Date: Sat, 11 May 2013 19:11:33 +0000 (UTC)

 Author: hrs
 Date: Sat May 11 19:11:20 2013
 New Revision: 250524
 URL: http://svnweb.freebsd.org/changeset/base/250524
 
 Log:
   MFC r250240:
   
   - Fix exit status when ip6addrctl_verbose=yes [*]
   - Use the absolute pathname for ip6addrctl.
   - Use "install" instead of "add" to reduce the number of invocations.
   
   Reported by:	Tatsuki Makino [*]
   PR:		conf/175006 [*]
 
 Modified:
   stable/9/etc/rc.d/ip6addrctl
 Directory Properties:
   stable/9/etc/rc.d/   (props changed)
 
 Modified: stable/9/etc/rc.d/ip6addrctl
 ==============================================================================
 --- stable/9/etc/rc.d/ip6addrctl	Sat May 11 19:05:38 2013	(r250523)
 +++ stable/9/etc/rc.d/ip6addrctl	Sat May 11 19:11:20 2013	(r250524)
 @@ -24,38 +24,42 @@ config_file="/etc/ip6addrctl.conf"
  set_rcvar_obsolete ipv6_enable ipv6_activate_all_interfaces
  set_rcvar_obsolete ipv6_prefer ip6addrctl_policy
  
 +IP6ADDRCTL_CMD="/usr/sbin/ip6addrctl"
 +
  ip6addrctl_prefer_ipv6()
  {
  	afexists inet6 || return 0
  
 -	ip6addrctl flush >/dev/null 2>&1
 -	ip6addrctl add ::1/128		 50	 0
 -	ip6addrctl add ::/0		 40	 1
 -	ip6addrctl add ::ffff:0:0/96	 35	 4
 -	ip6addrctl add 2002::/16	 30	 2
 -	ip6addrctl add 2001::/32	  5	 5
 -	ip6addrctl add fc00::/7		  3	13
 -	ip6addrctl add ::/96		  1	 3
 -	ip6addrctl add fec0::/10	  1	11
 -	ip6addrctl add 3ffe::/16	  1	12
 -	checkyesno ip6addrctl_verbose && ip6addrctl
 +	${IP6ADDRCTL_CMD} flush >/dev/null 2>&1
 +	cat <<EOT | ${IP6ADDRCTL_CMD} install /dev/stdin
 +	::1/128		 50	 0
 +	::/0		 40	 1
 +	::ffff:0:0/96	 35	 4
 +	2002::/16	 30	 2
 +	2001::/32	  5	 5
 +	fc00::/7	  3	13
 +	::/96		  1	 3
 +	fec0::/10	  1	11
 +	3ffe::/16	  1	12
 +EOT
  }
  
  ip6addrctl_prefer_ipv4()
  {
  	afexists inet6 || return 0
  
 -	ip6addrctl flush >/dev/null 2>&1
 -	ip6addrctl add ::1/128		 50	 0
 -	ip6addrctl add ::/0		 40	 1
 -	ip6addrctl add ::ffff:0:0/96	100	 4
 -	ip6addrctl add 2002::/16	 30	 2
 -	ip6addrctl add 2001::/32	  5	 5
 -	ip6addrctl add fc00::/7		  3	13
 -	ip6addrctl add ::/96		  1	 3
 -	ip6addrctl add fec0::/10	  1	11
 -	ip6addrctl add 3ffe::/16	  1	12
 -	checkyesno ip6addrctl_verbose && ip6addrctl
 +	${IP6ADDRCTL_CMD} flush >/dev/null 2>&1
 +	cat <<EOT | ${IP6ADDRCTL_CMD} install /dev/stdin
 +	::1/128		 50	 0
 +	::/0		 40	 1
 +	::ffff:0:0/96	100	 4
 +	2002::/16	 30	 2
 +	2001::/32	  5	 5
 +	fc00::/7	  3	13
 +	::/96		  1	 3
 +	fec0::/10	  1	11
 +	3ffe::/16	  1	12
 +EOT
  }
  
  ip6addrctl_start()
 @@ -66,9 +70,8 @@ ip6addrctl_start()
  	case "${ip6addrctl_policy}" in
  	[Aa][Uu][Tt][Oo])
  		if [ -r "${config_file}" -a -s "${config_file}" ]; then
 -			ip6addrctl flush >/dev/null 2>&1
 -			ip6addrctl install "${config_file}"
 -			checkyesno ip6addrctl_verbose && ip6addrctl
 +			${IP6ADDRCTL_CMD} flush >/dev/null 2>&1
 +			${IP6ADDRCTL_CMD} install "${config_file}"
  		else
  			if checkyesno ipv6_activate_all_interfaces; then
  				ip6addrctl_prefer_ipv6
 @@ -92,7 +95,7 @@ ip6addrctl_start()
  		ip6addrctl_prefer_ipv4
  	;;
  	[Nn][Oo][Nn][Ee])
 -		ip6addrctl flush >/dev/null 2>&1
 +		${IP6ADDRCTL_CMD} flush >/dev/null 2>&1
  	;;
  	*)
  		warn "\$ip6addrctl_policy is invalid: ${ip6addrctl_policy}. " \
 @@ -100,6 +103,11 @@ ip6addrctl_start()
  		ip6addrctl_prefer_ipv4
  	;;
  	esac
 +
 +	if checkyesno ip6addrctl_verbose; then
 +		echo 'Address selection policy table for IPv4 and IPv6:'
 +		${IP6ADDRCTL_CMD}
 +	fi
  }
  
  ip6addrctl_stop()
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
