diff options
author | Renato Botelho <renato.botelho@bluepex.com> | 2010-11-16 09:31:33 -0200 |
---|---|---|
committer | Renato Botelho <renato.botelho@bluepex.com> | 2010-11-16 09:31:33 -0200 |
commit | 39a8090a5a9ee447442ca6da154b0005b7e1bf80 (patch) | |
tree | fd327d4c1ebda352a39afdf83c0a9bf09f7c3b5f /etc/inc/interfaces.inc | |
parent | 129841508a5659a2c428213e0b231f9132fbfc4a (diff) | |
parent | e6b960ccffd51fd6a2ad190760f029608051f478 (diff) | |
download | pfsense-39a8090a5a9ee447442ca6da154b0005b7e1bf80.zip pfsense-39a8090a5a9ee447442ca6da154b0005b7e1bf80.tar.gz |
Merge remote branch 'mainline/master' into inc
Conflicts:
etc/inc/PEAR.inc
etc/inc/filter.inc
Diffstat (limited to 'etc/inc/interfaces.inc')
-rw-r--r-- | etc/inc/interfaces.inc | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 137930e..254932b 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1792,7 +1792,7 @@ EOD; fclose($fd); /* fire up dhclient */ - mwexec("/sbin/dhclient -c {$g['varetc_path']}/dhclient_{$vipif}.conf {$vipif} > {$g['tmp_path']}/{$vipif}_output > {$g['tmp_path']}/{$vipif}_error_output", false); + mwexec("/sbin/dhclient -c {$g['varetc_path']}/dhclient_{$vipif}.conf {$vipif} >{$g['tmp_path']}/{$vipif}_output 2>{$g['tmp_path']}/{$vipif}_error_output", false); } else { log_error(sprintf(gettext("Error: cannot open dhclient_%s.conf in interfaces_carpdev_configure() for writing.%s"), $vipif, "\n")); mwexec("/sbin/dhclient -b {$vipif}"); @@ -3208,9 +3208,6 @@ function get_interfaces_with_gateway() { /* loop interfaces, check config for outbound */ foreach($config['interfaces'] as $ifdescr => $ifname) { - if (substr($ifdescr, 0, 5) == "ovpnc") - return true; - switch ($ifname['ipaddr']) { case "dhcp": case "carpdev-dhcp": @@ -3222,7 +3219,8 @@ function get_interfaces_with_gateway() { $ints[$ifdescr] = $ifdescr; break; default: - if (!empty($ifname['gateway'])) + if (substr($ifname['if'], 0, 5) == "ovpnc" || + !empty($ifname['gateway'])) $ints[$ifdescr] = $ifdescr; break; } @@ -3235,8 +3233,6 @@ function interface_has_gateway($friendly) { global $config; if (!empty($config['interfaces'][$friendly])) { - if (substr($friendly, 0, 5) == "ovpnc") - return true; $ifname = &$config['interfaces'][$friendly]; switch ($ifname['ipaddr']) { case "dhcp": @@ -3248,6 +3244,8 @@ function interface_has_gateway($friendly) { return true; break; default: + if (substr($ifname['if'], 0, 5) == "ovpnc") + return true; if (!empty($ifname['gateway'])) return true; break; @@ -3283,9 +3281,9 @@ function is_altq_capable($int) { if (in_array($int_family[0], $capable)) return true; - else if (stristr($int_family, "vlan")) /* VLANs are name $parent_$vlan now */ + else if (stristr($int, "vlan")) /* VLANs are name $parent_$vlan now */ return true; - else if (stristr($int_family, "_wlan")) /* WLANs are name $parent_$wlan now */ + else if (stristr($int, "_wlan")) /* WLANs are name $parent_$wlan now */ return true; else return false; @@ -3438,7 +3436,13 @@ function setup_pppoe_reset_file($pppif, $iface="") { $cron_file = "{$g['varetc_path']}/pppoe_restart_{$pppif}"; if(!empty($iface) && !empty($pppif)){ - $cron_cmd = "#!/bin/sh\necho '<?php require(\"config.inc\"); require(\"interfaces.inc\"); interface_reconfigure({$iface}); log_error(\"PPPoE periodic reset executed on {$iface}\"); ?>' | /usr/local/bin/php -q"; + $cron_cmd = <<<EOD +#!/bin/sh +/usr/local/sbin/pfSctl -c 'interface reload {$iface}' +/usr/bin/logger -t pppoe{$iface} "PPPoE periodic reset executed on {$iface}" + +EOD; + file_put_contents($cron_file, $cron_cmd); chmod($cron_file, 0700); sigkillbypid("{$g['varrun_path']}/cron.pid", "HUP"); |