interfaces: configure ondemand ppp in background

The history of this dates back to m0n0wall and it seems what
this tries to achieve is restarting an instance of mpd that
will dial on demand later on so the idea is to start the service
when deconfiguring it.  That might seem "clear" but structurally
there's no reason to run a single shot configure during interface
disable step (likely through rc.linkup stop).
This commit is contained in:
Franco Fichtner 2022-02-02 13:56:09 +01:00
parent 3ccd2f0bdf
commit b899fa356a

View File

@ -1032,13 +1032,11 @@ function interface_bring_down($interface = "wan", $ifacecfg = false)
if (!empty($ppps)) {
foreach ($ppps as $ppp) {
if ($ifcfg['if'] == $ppp['if']) {
/* XXX $ifacecfg is very likely never false */
if (isset($ppp['ondemand']) && $ifacecfg === false) {
configdp_run('interface reconfigure', array($interface));
configdp_run('interface reconfigure', [$interface], true);
break;
}
killbypid("/var/run/{$ppp['type']}_{$interface}.pid", 'TERM', true);
@unlink("/var/etc/mpd_{$interface}.conf");
break;
}
}