From nobody@FreeBSD.org  Fri Jan 22 10:24:23 2010
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 CC57C1065670
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 22 Jan 2010 10:24:23 +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 BAA388FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 22 Jan 2010 10:24:23 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o0MAOMuB092382
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 22 Jan 2010 10:24:23 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id o0MAOMof092370;
	Fri, 22 Jan 2010 10:24:22 GMT
	(envelope-from nobody)
Message-Id: <201001221024.o0MAOMof092370@www.freebsd.org>
Date: Fri, 22 Jan 2010 10:24:22 GMT
From: Matthias Meyser <Meyser@xenet.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: hostapd startup missing multi wlan functionality
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         143079
>Category:       conf
>Synopsis:       hostapd(8) startup missing multi wlan functionality
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-wireless
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 22 10:30:04 UTC 2010
>Closed-Date:    
>Last-Modified:  Wed Jan  2 11:40:00 UTC 2013
>Originator:     Matthias Meyser
>Release:        FreeBSD 8-stable
>Organization:
XeNEt GmbH
>Environment:
FreeBSD wlan00.xenet.de 8.0-STABLE FreeBSD 8.0-STABLE #0: Thu Jan 14 20:04:44 CET 2010     root@intserv1.intern:/usr/obj/usr/src/sys/GATE  i386
>Description:
Hostapd itself can handle more than one wlan by using more than one configfile.
At the moment there ist only one hardcodeds configfile.
With the attached patch one or more configfiles can be set in rc.conf.
Default ist the original configfile.
>How-To-Repeat:

>Fix:
see patch

Patch attached with submission follows:

--- usr/src/etc/defaults/rc.conf.orig   2010-01-22 10:58:00.000000000 +0100
+++ usr/src/etc/defaults/rc.conf        2010-01-22 11:05:22.000000000 +0100
@@ -239,6 +239,8 @@

 ### Network daemon (miscellaneous) ###
 hostapd_enable="NO"            # Run hostap daemon.
+hostapd_config="/etc/hostapd.conf"     # Path to the configuration file
+#hostapd_config="/etc/hostapd.conf.wlan0 /etc/hostapd.conf.wlan1"      # Dual WLAN config
 syslogd_enable="YES"           # Run syslog daemon (or NO).
 syslogd_program="/usr/sbin/syslogd" # path to syslogd, if you want a different one.
 syslogd_flags="-s"             # Flags to syslogd (if enabled).

--- usr/src/etc/rc.d/hostapd.orig       2010-01-22 10:57:14.000000000 +0100
+++ usr/src/etc/rc.d/hostapd    2010-01-22 10:56:21.000000000 +0100
@@ -11,15 +11,14 @@

 name="hostapd"
 command="/usr/sbin/${name}"
-rcvar=`set_rcvar`
-
-conf_file="/etc/${name}.conf"
 pidfile="/var/run/${name}.pid"
-
-command_args="-P ${pidfile} -B ${conf_file}"
-required_files="${conf_file}"
+rcvar=`set_rcvar`
 required_modules="wlan_xauth wlan_wep wlan_tkip wlan_ccmp"
+
+load_rc_config $name
+config="${hostapd_config:-/etc/${name}.conf}"
+command_args="-P ${pidfile} -B ${config}"
+required_files="${config}"
 extra_commands="reload"

-load_rc_config ${name}
 run_rc_command "$1"



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: remko 
Responsible-Changed-When: Fri Jan 22 13:47:34 UTC 2010 
Responsible-Changed-Why:  
Reassign to networking team for evaluation, not sure whether net 
is best or -rc. 

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

From: Matthias Meyser <meyser@xenet.de>
To: bug-followup@FreeBSD.org, Meyser@xenet.de
Cc:  
Subject: Re: conf/143079: hostapd(8) startup missing multi wlan functionality
Date: Tue, 18 May 2010 08:10:02 +0200

 perhaps it schould be moved to -rc
 
 -- 
 Matthias Meyser        | XeNET Gesellschaft fuer Informations- und 
 Kommunikationssysteme mbH
 Tel.:  +49-5323-94018  | 38678 Clausthal-Zellerfeld, Burgstaetter Strasse 6
 Fax:   +49-5323-94014  | Registergericht: Amtsgericht Braunschweig, HRB 110823
 Email: Meyser@xenet.de | Geschaeftsfuehrer: Matthias Meyser
Responsible-Changed-From-To: freebsd-net->freebsd-wireless 
Responsible-Changed-By: adrian 
Responsible-Changed-When: Mon Apr 11 11:42:45 UTC 2011 
Responsible-Changed-Why:  
punt to wireless list 


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

From: Matthias Meyser <meyser@xenet.de>
To: bug-followup@FreeBSD.org, Meyser@xenet.de
Cc:  
Subject: Re: conf/143079: hostapd(8) startup missing multi wlan functionality
Date: Wed, 02 Jan 2013 12:14:37 +0100

 Updated patch for /etc/rc.d/hostapd
 
 --- hostapd.orig        2013-01-02 11:13:29.000000000 +0100
 +++ hostapd     2013-01-02 12:04:04.000000000 +0100
 @@ -13,7 +13,9 @@
   rcvar="hostapd_enable"
   command="/usr/sbin/${name}"
 
 -conf_file="/etc/${name}.conf"
 +load_rc_config ${name}
 +
 +conf_file="${hostapd_config:-/etc/${name}.conf}"
   pidfile="/var/run/${name}.pid"
 
   command_args="-P ${pidfile} -B ${conf_file}"
 @@ -21,5 +23,4 @@
   required_modules="wlan_xauth wlan_wep wlan_tkip wlan_ccmp"
   extra_commands="reload"
 
 -load_rc_config ${name}
   run_rc_command "$1"
 
 
 
 -- 
 Matthias Meyser        | XeNET Gesellschaft fuer Informations- und 
 Kommunikationssysteme mbH
 Tel.:  +49-5323-94018  | 38678 Clausthal-Zellerfeld, Burgstaetter Strasse 6
 Fax:   +49-5323-94014  | Registergericht: Amtsgericht Braunschweig, HRB 110823
 Email: Meyser@xenet.de | Geschaeftsfuehrer: Matthias Meyser
>Unformatted:
