diff options
author | Vinicius Coque <vinicius.coque@bluepex.com> | 2011-03-25 08:49:04 -0300 |
---|---|---|
committer | Vinicius Coque <vinicius.coque@bluepex.com> | 2011-03-25 08:49:04 -0300 |
commit | 54bdff758f68e2e1b1ebd42b8b0b629b68ed1a3d (patch) | |
tree | 27b7d45e582e3d84cdf8d0fa0f3bc93b65f3c986 /etc/inc/interfaces.inc | |
parent | b845290619244e8cfe3bc2aa6271c6629eeb86b5 (diff) | |
parent | 401fb0ad8fa7ad06743435808dac8e913b3c16bb (diff) | |
download | pfsense-54bdff758f68e2e1b1ebd42b8b0b629b68ed1a3d.zip pfsense-54bdff758f68e2e1b1ebd42b8b0b629b68ed1a3d.tar.gz |
Merge remote-tracking branch 'mainline/master' into inc
Conflicts:
etc/inc/auth.inc
etc/inc/config.lib.inc
etc/inc/filter.inc
etc/inc/pfsense-utils.inc
etc/inc/pkg-utils.inc
etc/inc/priv.defs.inc
etc/inc/services.inc
etc/inc/shaper.inc
etc/inc/voucher.inc
etc/inc/vpn.inc
usr/local/www/fbegin.inc
Diffstat (limited to 'etc/inc/interfaces.inc')
-rw-r--r-- | etc/inc/interfaces.inc | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 60201bd..e678b3b 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1143,7 +1143,14 @@ function handle_pppoe_reset($post_array) { function interface_ppps_configure($interface) { global $config, $g; - + + /* Return for unassigned interfaces. This is a minimum requirement. */ + if (empty($config['interfaces'][$interface])) + return 0; + $ifcfg = $config['interfaces'][$interface]; + if (!isset($ifcfg['enable'])) + return 0; + // mpd5 requires a /var/spool/lock directory for PPP modem links. if(!is_dir("/var/spool/lock")) { exec("/bin/mkdir -p /var/spool/lock"); @@ -1152,10 +1159,7 @@ function interface_ppps_configure($interface) { // mpd5 modem chat script expected in the same directory as the mpd_xxx.conf files if (!file_exists("{$g['varetc_path']}/mpd.script")) mwexec("/bin/ln -s /usr/local/sbin/mpd.script {$g['varetc_path']}/."); - - $ifcfg = $config['interfaces'][$interface]; - if (!isset($ifcfg['enable'])) - return 0; + if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) { foreach ($config['ppps']['ppp'] as $pppid => $ppp) { if ($ifcfg['if'] == $ppp['if']) @@ -1172,7 +1176,7 @@ function interface_ppps_configure($interface) { else $type = $ppp['type']; $upper_type = strtoupper($ppp['type']); - + if($g['booting']) { $descr = isset($ifcfg['descr']) ? $ifcfg['descr'] : strtoupper($interface); echo "starting {$pppif} link..."; @@ -1180,7 +1184,7 @@ function interface_ppps_configure($interface) { if(file_exists("{$g['varrun_path']}/{$ppp['type']}_{$interface}.pid")) return 0; } - + $ports = explode(',',$ppp['ports']); if ($type != "modem") { foreach ($ports as $pid => $port) @@ -1189,10 +1193,10 @@ function interface_ppps_configure($interface) { $localips = explode(',',$ppp['localip']); $gateways = explode(',',$ppp['gateway']); $subnets = explode(',',$ppp['subnet']); - + /* We bring up the parent interface first because if DHCP is configured on the parent we need - to obtain an address first so we can write it in the mpd .conf file for PPTP and L2TP configs - */ + * to obtain an address first so we can write it in the mpd .conf file for PPTP and L2TP configs + */ foreach($ports as $pid => $port){ switch ($ppp['type']) { case "pppoe": @@ -2469,7 +2473,7 @@ function kill_wpasupplicant($interface) { function find_dhclient_process($interface) { if ($interface) - $pid = `/bin/pgrep -xf "dhclient: {$interface}"`; + $pid = `/bin/pgrep -axf "dhclient: {$interface}"`; else $pid = 0; @@ -3480,8 +3484,8 @@ function is_altq_capable($int) { * http://www.freebsd.org/cgi/man.cgi?query=altq&manpath=FreeBSD+7.2-current&format=html * Only the following drivers have ALTQ support */ - $capable = array("age", "ale", "an", "ath", "aue", "awi", "bce", - "bfe", "bge", "dc", "de", "ed", "em", "ep", "fxp", "gem", + $capable = array("age", "alc", "ale", "an", "ath", "aue", "awi", "bce", + "bfe", "bge", "bridge", "cas", "dc", "de", "ed", "em", "ep", "fxp", "gem", "hme", "igb", "ipw", "iwi", "jme", "le", "lem", "msk", "mxge", "my", "nfe", "npe", "nve", "ral", "re", "rl", "rum", "run", "bwn", "sf", "sis", "sk", "ste", "stge", "txp", "udav", "ural", "vge", "vr", "wi", "xl", |