Update madwifi to r4003 and switch hal to test-hal

fixes at hostapd initskript (set madwifi specific command only if madwifi is configured)
fix setup use wrong macaddress for Wlan if it is an AP-mode
This commit is contained in:
Arne Fitzenreiter
2009-04-18 12:46:07 +02:00
parent 5f1ae478c4
commit 79ef49bd5e
4 changed files with 39 additions and 31 deletions

View File

@@ -1,3 +1,4 @@
bin/probenic.sh
etc/ntp
etc/rc.d/init.d/snort
etc/ssh/moduli

View File

@@ -24,7 +24,7 @@
include Config
VER = trunk-r3994-20090410
VER = hal-testing-r4003-20090416
THISAPP = madwifi-$(VER)
DL_FILE = $(THISAPP).tar.gz
@@ -44,7 +44,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_MD5 = 9dbd2c1fd3f1aa53f4bdc64531192587
$(DL_FILE)_MD5 = f9c591f16746a4ac4988ccbfedfe1a85
install : $(TARGET)

View File

@@ -5,52 +5,56 @@
CHANNEL="05"
TXPOWER="auto"
INTERFACE="blue0"
MACMODE="0"
DRIVER="MADWIFI"
eval $(/usr/local/bin/readhash /var/ipfire/wlanap/settings)
case "${1}" in
start)
mkdir -p /var/run/hostapd
if [ "$(/usr/sbin/iwconfig $INTERFACE | /bin/grep "Mode:Master")" == "" ]; then
boot_mesg "Setting wlan $INTERFACE to Master mode... "
# Set Atheros Cards to master mode
if [ -d /proc/net/madwifi/ath0/ ]; then
/usr/bin/wlanconfig ath0 destroy > /dev/null
if [ "$DRIVER" == "MADWIFI" ]; then
if [ "$(/usr/sbin/iwconfig $INTERFACE | /bin/grep "Mode:Master")" == "" ]; then
boot_mesg "Setting MADWIFI wlan $INTERFACE to Master mode... "
# Set Atheros Cards to master mode
/usr/bin/wlanconfig $INTERFACE destroy > /dev/null
/usr/bin/wlanconfig $INTERFACE create wlandev wifi0 wlanmode ap > /dev/null
fi
fi
/usr/bin/wlanconfig $INTERFACE destroy > /dev/null
/usr/bin/wlanconfig $INTERFACE create wlandev wifi0 wlanmode ap > /dev/null
boot_mesg "Starting hostapd... "
/usr/sbin/iwconfig $INTERFACE channel $CHANNEL
/usr/sbin/iwconfig $INTERFACE txpower $TXPOWER
/usr/bin/hostapd -P /var/run/hostapd /etc/hostapd.conf </dev/tty12 >/dev/tty12 2>&1 &
# Set other cards to master mode
#/usr/sbin/iwconfig blue0 mode master
if [ $DRIVER == "MADWIFI" ]; then
iwpriv $INTERFACE maccmd 3
if [ $MACMODE != 0 ]; then
FILE="/var/ipfire/wlanap/macfile"
exec < $FILE
while read LINE
do
iwpriv $INTERFACE addmac $LINE
done
iwpriv $INTERFACE maccmd $MACMODE
fi
# Disable background scann
iwpriv $INTERFACE bgscan 0
# Set beacon interval to 500
iwpriv $INTERFACE bintval 500
fi
if [ "$(/usr/sbin/iwconfig $INTERFACE | /bin/grep "Mode:Master")" == "" ]; then
boot_mesg "Error! Can't set wlan master mode"
echo_failure;
exit 1;
exit 0;
else
# enable wlan module of collectd
sed -i -e "s|#LoadPlugin wireless|LoadPlugin wireless|g" /etc/collectd.conf
boot_mesg "Starting hostapd... "
/usr/sbin/iwconfig $INTERFACE channel $CHANNEL
/usr/sbin/iwconfig $INTERFACE txpower $TXPOWER
/usr/bin/hostapd -P /var/run/hostapd /etc/hostapd.conf </dev/tty12 >/dev/tty12 2>&1 &
evaluate_retval
fi
iwpriv $INTERFACE maccmd 3
if [ $MACMODE != 0 ]; then
FILE="/var/ipfire/wlanap/macfile"
exec < $FILE
while read LINE
do
iwpriv $INTERFACE addmac $LINE
done
iwpriv $INTERFACE maccmd $MACMODE
echo_ok
fi
;;

View File

@@ -21,4 +21,7 @@
kudzu -qps -c NETWORK | egrep "desc|network.hwaddr|driver" > /var/ipfire/ethernet/scanned_nics 2>/dev/null
# Revert Accesspoint marking at mac address
sed -i 's|hwaddr: 06:|hwaddr: 00:|g' /var/ipfire/ethernet/scanned_nics
exit 0