git: rc.d/wg: Match wg ifnames on wg_start
Antonio Huete Jimenez
tuxillo at crater.dragonflybsd.org
Wed Mar 27 07:44:24 PDT 2024
commit 212e48ceabe0c8b9237715a45859367fbc0df8ad
Author: Antonio Huete Jimenez <tuxillo at quantumachine.net>
Date: Wed Mar 27 14:30:57 2024 +0100
rc.d/wg: Match wg ifnames on wg_start
Specifying wg_interfaces="wg0" in /etc/rc.conf causes:
ifconfig: ioctl SIOCSIFNAME (set name): File exists
The interface name matching in the wg script is not matching the
'wg' interfaces thus trying to set a custom interface name.
Apparently expr does not interpret '+' from regex:
$ expr 'wg0' : 'wg[0-9]+$' && echo matched
0
Workaround it by using already working expr usage:
$ expr 'wg0' : 'wg[0-9][0-9]*$' && echo matched
3
matched
There is no need to anchor the beginning of line with ^ since
expr already does that.
Summary of changes:
etc/rc.d/wg | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/212e48ceabe0c8b9237715a45859367fbc0df8ad
--
DragonFly BSD source repository
More information about the Commits
mailing list