1
Development and Code Review / Wireguard Bug (develop stream)
« on: August 31, 2023, 05:09:18 pm »
BUG:
Unable to add route when disable routes is checked, however a gateway IP is provided in the config.
ERROR:
file in question:
Location in file: line 91
BAD CODE
FIX
Unable to add route when disable routes is checked, however a gateway IP is provided in the config.
ERROR:
Code: [Select]
2023-08-31T14:39:40 Error wireguard /usr/local/opnsense/scripts/Wireguard/wg-service-control.php: The command '/sbin/route -q -n add -'-4' '10.64.0.1' -iface 'wg4'' returned exit code '64', the output was 'route: bad keyword: -4 route: usage: route [-46dnqtv] command [[modifiers] args]'
file in question:
Code: [Select]
/usr/local/opnsense/scripts/Wireguard/wg-service-control.php
Location in file: line 91
BAD CODE
Code: [Select]
mwexecf('/sbin/route -q -n add -%s %s -iface %s', [$ipprefix, $server->gateway, $server->interface]);
FIX
Code: [Select]
mwexecf('/sbin/route -q -n add %s %s -iface %s', [$ipprefix, $server->gateway, $server->interface]);