From nobody@FreeBSD.org  Sat Aug  9 12:31:32 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2F7DA106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  9 Aug 2008 12:31:32 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 1E8108FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  9 Aug 2008 12:31:32 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m79CVVV0050959
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 9 Aug 2008 12:31:31 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m79CVVAk050958;
	Sat, 9 Aug 2008 12:31:31 GMT
	(envelope-from nobody)
Message-Id: <200808091231.m79CVVAk050958@www.freebsd.org>
Date: Sat, 9 Aug 2008 12:31:31 GMT
From: Jean-Charles Longuet <jclonguet@free.fr>
To: freebsd-gnats-submit@FreeBSD.org
Subject: rc.conf ifconfig_xx keywords cannot be escaped
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         126392
>Category:       conf
>Synopsis:       [patch] rc.conf ifconfig_xx keywords cannot be escaped
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-rc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 09 12:40:01 UTC 2008
>Closed-Date:    
>Last-Modified:  Tue Dec 02 13:31:58 UTC 2008
>Originator:     Jean-Charles Longuet
>Release:        7.0-RELEASE
>Organization:
none
>Environment:
FreeBSD soekris 7.0-RELEASE FreeBSD 7.0-RELEASE #4: Sun Aug  3 16:35:00 CEST 2008     root@soekris-master:/usr/obj/usr/src/sys/NET4801  i386

>Description:
Special keywords in ifconfig_xx varaibles in /etc/rc.conf cannot be escaped. However, some of these keywords may be mandatory in ifconfig arguments, for example, in :

ifconfig_ath0="inet 192.168.101.1 netmask 255.255.255.0 ssid Winet channel 9 mode 11g mediaopt hostap media OFDM54 authmode WPA"

The "WPA" is used to mounf the interface using WPA, insead of setting the authmode.

>How-To-Repeat:

Configure an interface this way :
ifconfig_ath0="inet 192.168.101.1 netmask 255.255.255.0 ssid Winet channel 9 mode 11g mediaopt hostap media OFDM54 authmode WPA"

Other keywords like DHCP may trigger the problem as well.
>Fix:


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: brooks 
State-Changed-When: Mon Aug 11 17:43:00 UTC 2008 
State-Changed-Why:  
Requested feedback. 


Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: brooks 
Responsible-Changed-When: Mon Aug 11 17:43:00 UTC 2008 
Responsible-Changed-Why:  
This is part of rc.d. 

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

From: Brooks Davis <brooks@freebsd.org>
To: Jean-Charles Longuet <jclonguet@free.fr>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: conf/126392: rc.conf ifconfig_xx keywords cannot be escaped
Date: Mon, 11 Aug 2008 12:43:34 -0500

 Setting "authmode WPA" makes no sense.  It's only supported by ifconfig for
 completeness and is useless without wpa_supplicant.  As such I can't see a
 reason to try to fix this.  Do you have a practical example?
 
 -- Brooks

From: Jean-Charles Longuet <jclonguet@laposte.net>
To: bug-followup@freebsd.org, jclonguet@free.fr
Cc:  
Subject: Re: conf/126392: rc.conf ifconfig_xx keywords cannot be escaped
Date: Tue, 12 Aug 2008 21:10:04 +0200

  
  From what I understand, wpa_supplicant is only used by client stations. 
 In my case, I am configuring an access point with hostapd for the wpa 
 handling, and do not require wpa_supplicant in any way, hence the 
 configuration line I added in the intial report.
 
 More generaly, keywords can not be used anywhere in the ifconfig command 
 line: you cannot set your ssid to such values, for example. There are 
 workarounds, like running an extra ifconfig command in start_if.ath0, 
 but that's just plain ugly, and I use FreeBSD to avoid this. Having an 
 extra keyword meaning "do not look thereafter" could do the trick 
 (something like "--" on command lines).
 
 --  Jc
 

From: Jean-Charles Longuet <jclonguet@laposte.net>
To: bug-followup@FreeBSD.org, jclonguet@free.fr
Cc:  
Subject: Re: conf/126392: rc.conf ifconfig_xx keywords cannot be escaped
Date: Sat, 23 Aug 2008 11:02:31 +0200

 This is a multi-part message in MIME format.
 --------------080700040509060605030705
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Here is a patch for /etc/network.subr that handles a special
 string "--" so that keywords found thereafter are ignored.
 
 -- Jc
 
 --------------080700040509060605030705
 Content-Type: text/plain;
  name="network.subr.patch"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="network.subr.patch"
 
 --- /etc/network.subr.ORIG	2008-08-12 22:24:50.000000000 +0200
 +++ /etc/network.subr	2008-08-12 22:24:59.000000000 +0200
 @@ -142,18 +142,26 @@
  		return 1
  	fi
  	_args=
 +	eoparsing=0
  
  	for _arg in $_tmpargs; do
 -		case $_arg in
 -		[Dd][Hh][Cc][Pp]) ;;
 -		[Nn][Oo][Aa][Uu][Tt][Oo]) ;;
 -		[Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;;
 -		[Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;;
 -		[Ww][Pp][Aa]) ;;
 -		*)
 +		if [ $eoparsing -eq 0 ]; then
 +			case $_arg in
 +			[Dd][Hh][Cc][Pp]) ;;
 +			[Nn][Oo][Aa][Uu][Tt][Oo]) ;;
 +			[Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;;
 +			[Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;;
 +			[Ww][Pp][Aa]) ;;
 +			--)
 +				eoparsing=1
 +				;;
 +			*)
 +				_args="$_args $_arg"
 +				;;
 +			esac
 +		else
  			_args="$_args $_arg"
 -			;;
 -		esac
 +		fi
  	done
  
  	echo $_args
 @@ -170,6 +178,9 @@
  		[Nn][Oo][Aa][Uu][Tt][Oo])
  			return 1
  			;;
 +		--)
 +			return 0
 +			;;
  		esac
  	done
  	return 0
 @@ -191,6 +202,9 @@
  		[Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp])
  			return 0
  			;;
 +		--)
 +			return 1
 +			;;
  		esac
  	done
  	return 1
 @@ -210,6 +224,13 @@
  		[Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp])
  			return 0
  			;;
 +		--)
 +			if checkyesno synchronous_dhclient; then
 +				return 0
 +			else
 +				return 1
 +			fi
 +			;;
  		esac
  	done
  	if checkyesno synchronous_dhclient; then
 @@ -229,6 +250,9 @@
  		[Ww][Pp][Aa])
  			return 0
  			;;
 +		--)
 +			return 1
 +			;;
  		esac
  	done
  	return 1
 
 --------------080700040509060605030705--
State-Changed-From-To: feedback->open 
State-Changed-By: gavin 
State-Changed-When: Tue Dec 2 13:29:56 UTC 2008 
State-Changed-Why:  
Feedback and a patch was received some time ago. 

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