From b899fa356aeb2416d125c9bcfdf26a4a6ac219c4 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 2 Feb 2022 13:56:09 +0100 Subject: [PATCH] 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). --- src/etc/inc/interfaces.inc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 652e42a67..8d48e07e0 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -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; } }