From 2798bb681fabea10355177eab12132daaec90e88 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Wed, 25 Feb 2015 23:06:32 +0545 Subject: interface_netgraph_needed can miss setting found equals true This routine seems to go looking to see if the passed-in interface is PPP-style. At the end, if it is not PPP-style then it calls pfsense_ngctl_detach. This foreach loop in its current state will always exit after the first iteration that is not mode "server". But it looks like it should look through all the 'pppoe' entries until it finds the interface or gets to the end. In theory the code will sometimes miss setting $found = true when it should have. And thus pfsense_ngctl_detach would get called later for a PPP-style interface. I noticed this while reviewing for code style guide - it is an example where the indenting shows the intention but there are no curlies to implement it. --- etc/inc/interfaces.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'etc') diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 60c394e..e266ede 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -134,9 +134,10 @@ function interface_netgraph_needed($interface = "wan") { foreach ($config['pppoes']['pppoe'] as $pppoe) { if ($pppoe['mode'] != "server") continue; - if ($pppoe['interface'] == $interface) + if ($pppoe['interface'] == $interface) { $found = true; break; + } } } if ($found == false) -- cgit v1.1