Instead of looking at vlans and adding one to the last, which if someone did manual configuration could be inaccurate as ifconfig returns vlans in the order they were created.
(oops, just noticed the extra newline, will fix that) Comments, OK? Index: install.sub =================================================================== RCS file: /cvs/src/distrib/miniroot/install.sub,v retrieving revision 1.1228 diff -u -p -r1.1228 install.sub --- install.sub 16 Feb 2023 18:10:28 -0000 1.1228 +++ install.sub 19 Feb 2023 20:09:01 -0000 @@ -1308,7 +1308,7 @@ ieee80211_config() { # Set up IPv4 and IPv6 interface configuration. configure_ifs() { - local _first _hn _if _ifs _lladdr _name _p _q _vi _vn + local _first _hn _if _ifs _lladdr _name _p _q _vn resp= # Always need lo0 configured. @@ -1324,14 +1324,12 @@ configure_ifs() { # physical interface to begin with. ((${#_ifs[*]} == 0)) && break - # Discover last configured vlan interface and increment its - # minor for the next offered vlan interface. - _vi= - for _if in "${_ifs[@]}"; do - [[ $_if = vlan+([[:digit:]]) ]] && _vi=${_if#vlan} + # Discover the next unconfigured vlan interface + _vn=vlan0 + while isin $_vn "${_ifs[@]}"; do + _vn=vlan$(( ${_vn#vlan} + 1 )) done - [[ -n $_vi ]] && ((_vi++)) - [[ -n ${_ifs[*]} ]] && _vn="vlan${_vi:-0}" + echo "Available network interfaces are: ${_ifs[*]} $_vn." if [[ $resp == '?' ]]; then