From 9ff9a1c7d42a74b6ef628ed684b0594576516d5f Mon Sep 17 00:00:00 2001 From: Seth Mos Date: Thu, 24 Dec 2009 13:45:04 +0100 Subject: Style fixes for the interfaces page, use switch instead of a large if,elseif procedure. Fix the monitor IP route adding and removing to skip non IP addresses and dynamic entries Add a Gateway item on the gateway_item stack so that it properly shows up in th configuration. Static configurations will need to manually add one. --- etc/inc/gwlb.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'etc') diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 94ce050..92eaf28 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -163,11 +163,11 @@ EOD; * route as this will break the routing table */ continue; } else { - mwexec("/sbin/route delete -host " . escapeshellarg($gateway['monitor'])); - if(! stristr("127.0.0", $gateway['gateway'])) { + if(($gateway['gateway'] != "dynamic") && (is_ipaddr($gateway['gateway']))) { + mwexec("/sbin/route delete -host " . escapeshellarg($gateway['monitor'])); mwexec("/sbin/route add -host " . escapeshellarg($gateway['monitor']) . " " . escapeshellarg($gateway['gateway'])); - log_error("Removing static route for monitor {$gateway['monitor']} and adding a new route through {$gateway['gateway']}"); + log_error("Removing static route for monitor {$gateway['monitor']} and adding a new route through {$gateway['gateway']}"); } } } -- cgit v1.1