diff options
author | Ermal <eri@pfsense.org> | 2013-09-03 16:52:07 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-09-03 16:52:23 +0000 |
commit | c9d099d788071ad944d47676e086da91faf7faf3 (patch) | |
tree | 76a3ae8e9c75b1371b80594b3bc06c5d0cc81614 /etc | |
parent | c59e21b5c706b46159ecc19b33977299754b07b9 (diff) | |
download | pfsense-c9d099d788071ad944d47676e086da91faf7faf3.zip pfsense-c9d099d788071ad944d47676e086da91faf7faf3.tar.gz |
Bring back static routes to fix issues reported on Ticext #3179
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/config.lib.inc | 18 | ||||
-rw-r--r-- | etc/inc/gwlb.inc | 24 |
2 files changed, 34 insertions, 8 deletions
diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc index bbd6fec..ddcfd9b 100644 --- a/etc/inc/config.lib.inc +++ b/etc/inc/config.lib.inc @@ -384,14 +384,16 @@ function convert_config() { /* special case upgrades */ /* fix every minute crontab bogons entry */ - $cron_item_count = count($config['cron']['item']); - for($x=0; $x<$cron_item_count; $x++) { - if(stristr($config['cron']['item'][$x]['command'], "rc.update_bogons.sh")) { - if($config['cron']['item'][$x]['hour'] == "*" ) { - $config['cron']['item'][$x]['hour'] = "3"; - write_config(gettext("Updated bogon update frequency to 3am")); - log_error(gettext("Updated bogon update frequency to 3am")); - } + if (is_array($config['cron'])) { + $cron_item_count = count($config['cron']['item']); + for($x=0; $x<$cron_item_count; $x++) { + if(stristr($config['cron']['item'][$x]['command'], "rc.update_bogons.sh")) { + if($config['cron']['item'][$x]['hour'] == "*" ) { + $config['cron']['item'][$x]['hour'] = "3"; + write_config(gettext("Updated bogon update frequency to 3am")); + log_error(gettext("Updated bogon update frequency to 3am")); + } + } } } if ($config['version'] == $g['latest_config']) diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index 1adc751..e61d8da 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -162,6 +162,18 @@ EOD; $gwifip = find_interface_ip($gateway['interface'], true); if (!is_ipaddrv4($gwifip)) continue; //Skip this target + + /* + * If the gateway is the same as the monitor we do not add a + * route as this will break the routing table. + * Add static routes for each gateway with their monitor IP + * not strictly necessary but is a added level of protection. + */ + if (is_ipaddrv4($gateway['gateway']) && $gateway['monitor'] != $gateway['gateway']) { + log_error("Removing static route for monitor {$gateway['monitor']} and adding a new route through {$gateway['gateway']}"); + mwexec("/sbin/route change -host " . escapeshellarg($gateway['monitor']) . + " " . escapeshellarg($gateway['gateway']), true); + } } else if (is_ipaddrv6($gateway['gateway'])) { /* link locals really need a different src ip */ if(is_linklocal($gateway['gateway'])) { @@ -173,6 +185,18 @@ EOD; $gateway['monitor'] .= "%{$gateway['interface']}"; if (!is_ipaddrv6($gwifip)) continue; //Skip this target + + /* + * If the gateway is the same as the monitor we do not add a + * route as this will break the routing table. + * Add static routes for each gateway with their monitor IP + * not strictly necessary but is a added level of protection. + */ + if (is_ipaddrv6($gateway['gateway']) && $gateway['monitor'] != $gateway['gateway']) { + log_error("Removing static route for monitor {$gateway['monitor']} and adding a new route through {$gateway['gateway']}"); + mwexec("/sbin/route change -host -inet6 " . escapeshellarg($gateway['monitor']) . + " " . escapeshellarg($gateway['gateway']), true); + } } else continue; |