From 0bd7b7313293c127cf4782d5434273a5f3559566 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 22 May 2018 20:38:47 +0100 Subject: [PATCH] hostapd: Fix detection of wireless devices with kernel 4.14 Fixes #11738 Signed-off-by: Michael Tremer --- lfs/hostapd | 2 +- src/initscripts/packages/hostapd | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lfs/hostapd b/lfs/hostapd index 5b2f001d59..349a3d940c 100644 --- a/lfs/hostapd +++ b/lfs/hostapd @@ -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 = "" diff --git a/src/initscripts/packages/hostapd b/src/initscripts/packages/hostapd index 02e8c16147..27e79f0a7d 100644 --- a/src/initscripts/packages/hostapd +++ b/src/initscripts/packages/hostapd @@ -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 -- 2.39.2