HomeFreeBSD

ifconfig: improve trimming off interface number at end

Description

ifconfig: improve trimming off interface number at end

When trying to auto-load a module, we trim the interface number off
the end. Currently we stop at the first digit. For interfaces which
have numbers in the driver name this does not work well.
In the current example ifconfig ath10k0 would load ath(4) instead of
ath10k(4). For module/interface names like rtw88[0] we never guess
correctly.
To improve for the case we can, start trimming off digits from the
end rather than the front.

Sponsored by: The FreeBSD Foundation
Reported by: thierry
Reviewed by: melifaro, thierry
Differential Revision: https://reviews.freebsd.org/D40137

(cherry picked from commit 2e6756b752e07878ae5f5e3e9b74934231f9fd17)

Details

Provenance
bzAuthored on May 17 2023, 8:40 PM
Reviewer
melifaro
Differential Revision
D40137: ifconfig: improve trimming off interface number at end
Parents
rG6a50f0e12d9c: network.subr: adjust regex for wlans_xxxxx rc.conf entries
Branches
Unknown
Tags
Unknown