diff options
author | smos <seth.mos@dds.nl> | 2013-01-06 10:20:45 +0100 |
---|---|---|
committer | smos <seth.mos@dds.nl> | 2013-01-06 10:20:45 +0100 |
commit | e9ab2ddb2613df4726ca9202d1629a27904cc850 (patch) | |
tree | a0241a670fab78b5d39969d47c793ddb8f3b12fb /etc/inc/pfsense-utils.inc | |
parent | 5dbd619f4ac4f3ae161b7cf85ac82c9937cd62cc (diff) | |
download | pfsense-e9ab2ddb2613df4726ca9202d1629a27904cc850.zip pfsense-e9ab2ddb2613df4726ca9202d1629a27904cc850.tar.gz |
Add some backend support for writing out a config so that the dhcp6 server can listen on the required MPD pppoe server interfaces.
Also nuke the failover entries, these don't exist for IPv6, this is handled by 2 servers and differing priorities
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 7e84e76..8afd528 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1085,6 +1085,7 @@ function is_dhcpv6_server_enabled() $dhcpdenable = false; $Iflist = get_configured_interface_list(); + $Iflist = array_merge($Iflist, get_configured_pppoe_server_interfaces()); foreach($Iflist as $ifname) { if($config['interfaces'][$ifname]['track6-interface'] <> "") { @@ -2659,4 +2660,34 @@ function zte_simstate_to_string($state) { $string = "{$modes[$state]} State"; return $string; } + +function get_configured_pppoe_server_interfaces() { + global $config; + $iflist = array(); + if (is_array($config['pppoes']['pppoe'])) { + foreach($config['pppoes']['pppoe'] as $pppoe) { + if ($pppoe['mode'] == "server") { + $int = "poes". $pppoe['pppoeid']; + $iflist[$int] = strtoupper($int); + } + } + } + return $iflist; +} + +function get_pppoes_child_interfaces($ifpattern) { + $if_arr = array(); + if($ifpattern == "") + return; + + exec("ifconfig", $out, $ret); + foreach($out as $line) { + if(preg_match("/^({$ifpattern}[0-9]+):/i", $line, $match)) { + $if_arr[] = $match[1]; + } + } + return $if_arr; + +} + ?> |