network: wireguard: also accept negative boolean values to disable adding routes

RouteTable=off was introduced to provide consistency with wg-quick
command. This makes the RouteTable= settings accepts other negative
boolean values.
This commit is contained in:
Yu Watanabe
2022-01-16 19:25:28 +09:00
parent cfe1237f38
commit e135559d80
2 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -895,7 +895,7 @@ int config_parse_wireguard_route_table(
assert(data);
assert(userdata);
if (isempty(rvalue) || streq(rvalue, "off")) {
if (isempty(rvalue) || parse_boolean(rvalue) == 0) {
*table = 0; /* Disabled. */
return 0;
}
@@ -947,7 +947,7 @@ int config_parse_wireguard_peer_route_table(
return 0;
}
if (streq(rvalue, "off")) {
if (parse_boolean(rvalue) == 0) {
peer->route_table = 0; /* Disabled. */
peer->route_table_set = true;
TAKE_PTR(peer);