summaryrefslogtreecommitdiffstats
path: root/etc/inc/filter.inc
diff options
context:
space:
mode:
authorChris Buechler <cmb@cmb-macbook-pro-3.local>2009-12-20 22:51:06 -0500
committerChris Buechler <cmb@cmb-macbook-pro-3.local>2009-12-20 22:51:06 -0500
commit81f256c0b800c55f60342e72f1f395560b35616a (patch)
tree2bf815fa54bc18b18793038a83210f97dc52d8fd /etc/inc/filter.inc
parent654203108420876c1685cc92001e2b960a0dadba (diff)
downloadpfsense-81f256c0b800c55f60342e72f1f395560b35616a.zip
pfsense-81f256c0b800c55f60342e72f1f395560b35616a.tar.gz
clean this up a bit, add comments
Diffstat (limited to 'etc/inc/filter.inc')
-rw-r--r--etc/inc/filter.inc9
1 files changed, 5 insertions, 4 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index fc8c32d..4ab0a83 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -643,12 +643,14 @@ function filter_generate_optcfg_array()
}
if($config['ppps']) {
$ppp=0;
- $startingip = 1;
foreach($config['ppps']['ppp'] as $ifgen) {
+ // get the device name for this PPP connection minus /dev/ (e.g. cuaU0)
$dev = substr($ifgen['port'], 5);
+ // $ps is the PID of the ppp process matching this device
$ps = trim(`ps awux | grep -v grep | grep "$dev" | awk '{ print \$2 }'`);
if($ps) {
- $interface = trim(`ifconfig | grep -v grep | grep -B2 "$ps" | head -n1 | cut -d: -f1`);
+ // $interface is the device in use by the PID of the ppp process found above (e.g. tun0)
+ $interface = trim(`ifconfig | grep -B2 "$ps" | head -n1 | cut -d: -f1`);
if($interface) {
foreach ($config['interfaces'] as $ifdescr => $ifname) {
if($ifname['serialport'] == $dev) {
@@ -659,7 +661,6 @@ function filter_generate_optcfg_array()
unset($FilterIflist[$ifname['descr']]);
$FilterIflist[$ifname['descr']] = $oc;
$ppp++;
-
}
}
}
@@ -2397,4 +2398,4 @@ EOD;
return($ipfrules);
}
-?>
+?> \ No newline at end of file
OpenPOWER on IntegriCloud