Commit 1a7e961d authored by Franco Fichtner's avatar Franco Fichtner

interfaces: replace netgraph functions with portable alternatives

(cherry picked from commit 5adfd6bf)
parent 99ee12a2
......@@ -202,7 +202,7 @@ function interface_netgraph_needed($interface = "wan")
if (!$found) {
$realif = get_real_interface($interface);
mwexecf('/usr/sbin/ngctl msg %s: detach', array($realif));
legacy_netgraph_detach($realif);
}
}
......@@ -299,7 +299,7 @@ function interface_vlan_configure(&$vlan)
} else {
$tmpvlanif = legacy_interface_create('vlan');
legacy_interface_rename($tmpvlanif, $vlanif);
mwexecf('/usr/sbin/ngctl name %s: %s', array($tmpvlanif, $vlanif));
legacy_netgraph_rename($tmpvlanif, $vlanif);
}
legacy_vlan_tag($vlanif, $if, $tag);
......@@ -344,8 +344,8 @@ function interface_qinq_configure(&$vlan, $fd = null)
/* make sure the parent is converted to ng_vlan(4) and is up */
interfaces_bring_up($qinqif);
legacy_netgraph_attach($qinqif);
pfSense_ngctl_attach(".", $qinqif);
if (!empty($vlanif) && does_interface_exist($vlanif)) {
fwrite($fd, "shutdown {$qinqif}qinq:\n");
exec("/usr/sbin/ngctl msg {$qinqif}qinq: gettable", $result);
......@@ -1614,7 +1614,7 @@ function interface_ppps_configure($interface)
case "pppoe":
/* Bring the parent interface up */
interfaces_bring_up($port);
pfSense_ngctl_attach(".", $port);
legacy_netgraph_attach($port);
/* Enable setautosrc to automatically change mac address if parent interface's changes */
mwexecf('/usr/sbin/ngctl msg %s: setautosrc 1', array($port));
break;
......@@ -1637,7 +1637,7 @@ function interface_ppps_configure($interface)
log_error(sprintf(gettext('Could not get a PPTP/L2TP Remote IP address from %s for %s in interfaces_ppps_configure.'), $dhcp_gateway, $gway));
return 0;
}
pfSense_ngctl_attach(".", $port);
legacy_netgraph_attach($port);
break;
case "ppp":
if (!file_exists("{$port}")) {
......
......@@ -302,7 +302,7 @@ EOD;
chmod('/var/etc/pptp-vpn/mpd.secret', 0600);
/* fixed to WAN elsewhere, no need to extend, but at least make it work */
pfSense_ngctl_attach('.', get_real_interface('wan'));
legacy_netgraph_attach(get_real_interface('wan'));
mwexec('/usr/local/sbin/mpd4 -b -d /var/etc/pptp-vpn -p /var/run/pptp-vpn.pid -s pptps pptps');
......@@ -541,7 +541,7 @@ EOD;
chmod("/var/etc/pppoe{$pppoecfg['pppoeid']}-vpn/mpd.secret", 0600);
}
pfSense_ngctl_attach(".", $pppoe_interface);
legacy_netgraph_attach($pppoe_interface);
mwexec("/usr/local/sbin/mpd4 -b -d /var/etc/pppoe{$pppoecfg['pppoeid']}-vpn -p /var/run/pppoe{$pppoecfg['pppoeid']}-vpn.pid -s poes poes");
......@@ -730,7 +730,7 @@ EOD;
unset($mpdsecret);
chmod('/var/etc/l2tp-vpn/mpd.secret', 0600);
pfSense_ngctl_attach('.', get_real_interface($l2tpcfg['interface']));
legacy_netgraph_attach(get_real_interface($l2tpcfg['interface']));
mwexec('/usr/local/sbin/mpd4 -b -d /var/etc/l2tp-vpn -p /var/run/l2tp-vpn.pid -s l2tps l2tps');
......
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