From a4bcbd5a92fa381c0f5e4f26990dabd21606c084 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 23 Sep 2020 13:22:24 +0200 Subject: [PATCH] interfaces: update wireless prefixes, make it more maintainable PR: https://forum.opnsense.org/index.php?topic=19247.0 --- src/etc/inc/interfaces.inc | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index b7e25bbd6..686f44735 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -93,8 +93,35 @@ function convert_128bit_to_ipv6($ip6bin) function match_wireless_interface($int) { - $wireless_regex = '/^(ndis|wi|ath|an|ral|ural|iwi|wlan|rum|run|bwn|zyd|mwl|bwi|ipw|iwn|malo|uath|upgt|urtw|wpi)/'; - return preg_match($wireless_regex, $int); + $wireless_prefix = [ + 'an', + 'ath', + 'bwi', + 'bwn', + 'ipw', + 'iwi', + 'iwm', + 'iwn', + 'malo', + 'mwl', + 'ndis', + 'otus', + 'ral', + 'rsu', + 'rtwn', + 'rum', + 'run', + 'uath', + 'upgt', + 'ural', + 'urtw', + 'wi', + 'wlan', + 'wpi', + 'zyd', + ]; + + return preg_match('/^(' . implode('|', $wireless_prefix) . ')/', $int); } function interfaces_bring_up($interface)