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/ntp
etc/rc.d/init.d/snort etc/rc.d/init.d/snort
etc/ssh/moduli etc/ssh/moduli

View File

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

View File

@@ -5,52 +5,56 @@
CHANNEL="05" CHANNEL="05"
TXPOWER="auto" TXPOWER="auto"
INTERFACE="blue0" INTERFACE="blue0"
MACMODE="0"
DRIVER="MADWIFI"
eval $(/usr/local/bin/readhash /var/ipfire/wlanap/settings) eval $(/usr/local/bin/readhash /var/ipfire/wlanap/settings)
case "${1}" in case "${1}" in
start) start)
mkdir -p /var/run/hostapd mkdir -p /var/run/hostapd
if [ "$(/usr/sbin/iwconfig $INTERFACE | /bin/grep "Mode:Master")" == "" ]; then
boot_mesg "Setting wlan $INTERFACE to Master mode... " if [ "$DRIVER" == "MADWIFI" ]; then
if [ "$(/usr/sbin/iwconfig $INTERFACE | /bin/grep "Mode:Master")" == "" ]; then
# Set Atheros Cards to master mode boot_mesg "Setting MADWIFI wlan $INTERFACE to Master mode... "
if [ -d /proc/net/madwifi/ath0/ ]; then # Set Atheros Cards to master mode
/usr/bin/wlanconfig ath0 destroy > /dev/null /usr/bin/wlanconfig $INTERFACE destroy > /dev/null
/usr/bin/wlanconfig $INTERFACE create wlandev wifi0 wlanmode ap > /dev/null
fi
fi fi
/usr/bin/wlanconfig $INTERFACE destroy > /dev/null boot_mesg "Starting hostapd... "
/usr/bin/wlanconfig $INTERFACE create wlandev wifi0 wlanmode ap > /dev/null /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 if [ $DRIVER == "MADWIFI" ]; then
#/usr/sbin/iwconfig blue0 mode master
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 fi
if [ "$(/usr/sbin/iwconfig $INTERFACE | /bin/grep "Mode:Master")" == "" ]; then if [ "$(/usr/sbin/iwconfig $INTERFACE | /bin/grep "Mode:Master")" == "" ]; then
boot_mesg "Error! Can't set wlan master mode" boot_mesg "Error! Can't set wlan master mode"
echo_failure; echo_failure;
exit 1; exit 0;
else else
# enable wlan module of collectd # enable wlan module of collectd
sed -i -e "s|#LoadPlugin wireless|LoadPlugin wireless|g" /etc/collectd.conf sed -i -e "s|#LoadPlugin wireless|LoadPlugin wireless|g" /etc/collectd.conf
echo_ok
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
fi fi
;; ;;

View File

@@ -21,4 +21,7 @@
kudzu -qps -c NETWORK | egrep "desc|network.hwaddr|driver" > /var/ipfire/ethernet/scanned_nics 2>/dev/null 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 exit 0