]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
proxy: Skip VPNs that route everything for proxy.pac
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 24 Mar 2023 15:49:22 +0000 (15:49 +0000)
committerPeter Müller <peter.mueller@ipfire.org>
Sun, 25 Jun 2023 13:52:41 +0000 (13:52 +0000)
The function tries to figure out which networks are connected locally,
but VPN tunnels that use 0.0.0.0 and GRE/VTI interfaces will be
considered local and the proxy is being disabled for everyone.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/proxy.cgi

index a718d577130430df15146ae58dc2219e3a03fe43..71be315f63a963930f21ab12fa589965bb029eea 100644 (file)
@@ -2986,6 +2986,7 @@ END
                        foreach my $network (@networks) {
                                my ($vpnip, $vpnsub) = split("/", $network);
                                $vpnsub = &Network::convert_prefix2netmask($vpnsub) || $vpnsub;
+                               next if ($vpnip eq "0.0.0.0" || $vpnsub eq "0.0.0.0");
                                print FILE "     (isInNet(host, \"$vpnip\", \"$vpnsub\")) ||\n";
                        }
                }
@@ -2996,6 +2997,8 @@ END
                        my @networks = split(/\|/, $ovpnconfig{$key}[11]);
                        foreach my $network (@networks) {
                                my ($vpnip, $vpnsub) = split("/", $network);
+                               $vpnsub = &Network::convert_prefix2netmask($vpnsub) || $vpnsub;
+                               next if ($vpnip eq "0.0.0.0" || $vpnsub eq "0.0.0.0");
                                print FILE "     (isInNet(host, \"$vpnip\", \"$vpnsub\")) ||\n";
                        }
                }