Commit 30266056 authored by Ad Schellevis's avatar Ad Schellevis

(filter, plugins, pppoe) work in progress, pppoe server contains more...

(filter, plugins, pppoe) work in progress, pppoe server contains more instances. wrap items in 'items' property, to maintain old code. eventually we may need to define the data structure better.
parent a19f10fb
......@@ -696,24 +696,25 @@ function vpn_interface()
}
if (isset($config['pppoes']['pppoe'])) {
$pppoeifs = array('networks' => array());
$pppoeifs = array('items' => array());
foreach($config['pppoes']['pppoe'] as $pppoe) {
if ($pppoe['mode'] == "server") {
if (count($pppoeifs['networks'])) {
$pppoeifs = array();
$pppoeifs['enable'] = true;
$pppoeifs['if'] = 'pppoe';
$pppoeifs['descr'] = 'pppoe';
$pppoeifs['ip'] = "";
$pppoeifs['sa'] = "";
$pppoeifs['sn'] = "32";
$pppoeifs['mode'] = "";
$pppoeifs['virtual'] = true;
$interfaces['pppoe'] = $pppoeifs;
break;
}
$item = array('ip' => $pppoe['localip'], 'sa' => $pppoe['remoteip']);
$item['sn'] = !empty($pppoe['pppoe_subnet']) ? $pppoe['pppoe_subnet'] : "32";
$pppoeifs['items'][] = $item;
}
}
if (count($pppoeifs['items'])) {
$pppoeifs['enable'] = true;
$pppoeifs['if'] = 'pppoe';
$pppoeifs['descr'] = 'pppoe';
$pppoeifs['ip'] = "";
$pppoeifs['sa'] = "";
$pppoeifs['sn'] = "32";
$pppoeifs['mode'] = "";
$pppoeifs['virtual'] = true;
$interfaces['pppoe'] = $pppoeifs;
}
}
return $interfaces;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment