diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc index b7ef22ce6f0..3e941ae415f 100644 --- a/package/network/services/hostapd/files/hostapd.uc +++ b/package/network/services/hostapd/files/hostapd.uc @@ -412,7 +412,11 @@ function bss_reload_rxkhs(bss, config, old_config) function remove_file_fields(config) { - return filter(config, (line) => !hostapd.data.file_fields[split(line, "=")[0]]); + return filter(config, (line) => + !match(line, /^\s*$/) && + !match(line, /^\s*#/) && + !hostapd.data.file_fields[split(line, "=")[0]] + ); } function bss_remove_file_fields(config)