]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
hostapd: Fix detection of wireless devices with kernel 4.14
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 May 2018 19:38:47 +0000 (20:38 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 May 2018 19:38:47 +0000 (20:38 +0100)
Fixes #11738

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/hostapd
src/initscripts/packages/hostapd

index 5b2f001d59e893c2fda495d65a240886c3819df8..349a3d940cbf46e9606777ec28a0a183fbb8b177 100644 (file)
@@ -32,7 +32,7 @@ DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 PROG       = hostapd
-PAK_VER    = 41
+PAK_VER    = 42
 
 DEPS       = ""
 
index 02e8c161472623109f1586904e42b234eb760794..27e79f0a7de786c0e0fcbbc1baaa663e74785dc9 100644 (file)
@@ -17,18 +17,21 @@ case "${1}" in
                boot_mesg "Starting hostapd... "
 
                # Check Interface configuration
-               if ! ip link show $INTERFACE > /dev/null 2>&1; then
+               if [ ! -d "/sys/class/net/${INTERFACE}" ]; then
                        boot_mesg "Interface $INTERFACE doesn't exist." ${FAILURE}
                        echo_failure
                        exit 0
                fi
+
                if [ "$(ip link show $INTERFACE | /bin/grep "ether")" == "" ]; then
                        boot_mesg "Interface $INTERFACE is assigned to wlan master device." ${FAILURE}
                        boot_mesg "Please reboot to fix this." ${FAILURE}
                        echo_failure
                        exit 0
                fi
-               if [ "$(iwconfig $INTERFACE | /bin/grep "IEEE")" == "" ]; then
+
+               # Check if INTERFACE is an actual wireless device
+               if [ ! -d "/sys/class/net/${INTERFACE}/wireless" ]; then
                        boot_mesg "Interface $INTERFACE is no wireless device." ${FAILURE}
                        echo_failure
                        exit 0