Wireguard Bug (develop stream)

Started by despised, August 31, 2023, 05:09:18 PM

Previous topic - Next topic
BUG:

Unable to add route when disable routes is checked, however a gateway IP is provided in the config.

ERROR:

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:
/usr/local/opnsense/scripts/Wireguard/wg-service-control.php

Location in file: line 91
BAD CODE

mwexecf('/sbin/route -q -n add -%s %s -iface %s', [$ipprefix, $server->gateway, $server->interface]);


FIX

mwexecf('/sbin/route -q -n add %s %s -iface %s', [$ipprefix, $server->gateway, $server->interface]);