If there were multiple client routes configured, the OpenVPN server was
only told about the first one. This patch fixes this and also cleans up
the code for pushing the server routes, too.
Fixes: #13901 - iroute line is only written for the first of the OpenVPN client routes
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
foreach my $key (keys %client_routes) {
if ($client_routes{$key}[0] eq $name) {
- push(@routes, $client_routes{$key}[1]);
+ push(@routes, @{$client_routes{$key}}[1 .. $#{$client_routes{$key}}]);
}
}
foreach my $key (keys %server_routes) {
if ($server_routes{$key}[0] eq $name) {
- my $i = 1;
-
- while (my $route = $server_routes{$key}[$i++]) {
- push(@routes, $route);
- }
+ push(@routes, @{$server_routes{$key}}[1 .. $#{$server_routes{$key}}]);
}
}