summaryrefslogtreecommitdiffstats
path: root/etc/inc/interfaces.inc
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-02-25 23:06:32 +0545
committerPhil Davis <phil.davis@inf.org>2015-02-25 23:06:32 +0545
commit7af43cb02dcac5af8ed44ea1a65a91c6da7ee9c3 (patch)
tree07578d591dff37264bb432c840e31f97c1ac4ac3 /etc/inc/interfaces.inc
parent883096d8c634d2936266e04f29f79a145fc72a8b (diff)
downloadpfsense-7af43cb02dcac5af8ed44ea1a65a91c6da7ee9c3.zip
pfsense-7af43cb02dcac5af8ed44ea1a65a91c6da7ee9c3.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/inc/interfaces.inc')
-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 2a07901..2ca2bf3 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