summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-02-25 23:06:32 +0545
committerRenato Botelho <garga@FreeBSD.org>2015-02-26 09:28:25 -0300
commit2798bb681fabea10355177eab12132daaec90e88 (patch)
treecb88a90cb33debf1a8ee9580bd8541392e0d1ff0 /etc
parent8cf108b2242dd86bd9440fac40d5dfa7d564952e (diff)
downloadpfsense-2798bb681fabea10355177eab12132daaec90e88.zip
pfsense-2798bb681fabea10355177eab12132daaec90e88.tar.gz
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.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/interfaces.inc3
1 files changed, 2 insertions, 1 deletions
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)
OpenPOWER on IntegriCloud