Commit b0bcd62e authored by Ad Schellevis's avatar Ad Schellevis

(plugins, vpn) ditch pppoe side affect

parent eeca1881
......@@ -758,19 +758,6 @@ function filter_get_vpns_list() {
}
}
}
/* pppoe */
if (isset($config['pppoes']['pppoe']) && is_array($config['pppoes']['pppoe'])) {
foreach($config['pppoes']['pppoe'] as $pppoe) {
if ($pppoe['mode'] == "server") {
if (is_ipaddr($pppoe['remoteip'])) {
$pppoesub = gen_subnet($pppoe['remoteip'], $pppoe['pppoe_subnet']);
if (is_subnet($pppoesub)) {
$vpns_arr[] = $pppoesub;
}
}
}
}
}
if (!empty($vpns_arr)) {
$vpns = implode(" ", $vpns_arr);
......
......@@ -699,28 +699,21 @@ function vpn_interface()
$pppoeifs = array('networks' => array());
foreach($config['pppoes']['pppoe'] as $pppoe) {
if ($pppoe['mode'] == "server") {
$oic = array();
$oic['sa'] = $pppoe['remoteip'];
if ($pppoe['pppoe_subnet'] <> "") {
$oic['sn'] = $pppoe['pppoe_subnet'];
} else {
$oic['sn'] = "32";
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;
}
$oic['ip'] = $pppoe['localip'];
$pppoeifs['networks'][] = $oic;
}
}
if (count($pppoeifs['networks'])) {
$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