summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2010-01-27 20:19:42 +0000
committerErmal Luçi <eri@pfsense.org>2010-01-27 20:19:42 +0000
commit37a23c2dd90c32492b3cf43f9126e5f4153ccb78 (patch)
tree5f8091ecf3a1009f19ade171101a2df91272e05f
parent73780aef930a96dac5e1a2350e70e8003ddb5a38 (diff)
downloadpfsense-37a23c2dd90c32492b3cf43f9126e5f4153ccb78.zip
pfsense-37a23c2dd90c32492b3cf43f9126e5f4153ccb78.tar.gz
Try to prevent breaking the ruleset when ppp is not connected. This should fix most problems with ppp.
-rw-r--r--etc/inc/filter.inc12
-rw-r--r--etc/inc/interfaces.inc12
2 files changed, 11 insertions, 13 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index a9cc9ac..07274d9 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -593,6 +593,8 @@ function filter_generate_optcfg_array() {
$oc = $config['interfaces'][$if];
$oic = array();
$oic['if'] = get_real_interface($if);
+ if (!does_interface_exist($oic['if']))
+ continue;
$oic['ip'] = get_interface_ip($if);
if(!is_ipaddr($oc['ipaddr']) && !empty($oc['ipaddr']))
$oic['type'] = $oc['ipaddr'];
@@ -2239,19 +2241,15 @@ function filter_tdr_month($schedule) {
}
function filter_setup_logging_interfaces() {
- global $config;
+ global $config, $FilterIflist;
if(isset($config['system']['developerspew'])) {
$mt = microtime();
echo "filter_setup_logging_interfaces() being called $mt\n";
}
$rules = "";
- $i = 0;
- /* if list */
- $ifdescrs = get_configured_interface_list();
- foreach ($ifdescrs as $ifdescr => $ifname) {
+ foreach ($FilterIflist as $ifdescr => $ifname) {
/* do not work with tun interfaces */
- $int = get_real_interface($ifname);
- $rules .= "set loginterface {$int}\n";
+ $rules .= "set loginterface {$ifname['if']}\n";
}
return $rules;
}
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index ce05696..f5e70ca 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -905,7 +905,7 @@ function interface_ppp_configure($ifcfg,$edit=false) {
$peerfile .= " set ifaddr {$ppp['localip']}/0 10.0.0.{$endingip}/0 255.255.255.0 0.0.0.0\n";
if(!$ppp['localip'] and !$ppp['gateway'])
$peerfile .= " set ifaddr 10.0.0.{$startingip}/0 10.0.0.{$endingip}/0 255.255.255.0 0.0.0.0\n";
- $peerfile .= " iface name ppp_{$orig_dev}\n";
+ //$peerfile .= " iface name ppp_{$orig_dev}\n";
$peerfile .= " set phone \"{$ppp['phone']}\"\n";
$peerfile .= " set authname \"{$ppp['username']}\"\n";
$peerfile .= " set authkey \"{$ppp['password']}\"\n";
@@ -926,6 +926,7 @@ function interface_ppp_configure($ifcfg,$edit=false) {
$rclinkdown .= " ! sh -c \"/etc/rc.conf_mount_rw\"\n";
$rclinkdown .= " ! sh -c \"/bin/echo `date -j +%Y.%m.%d-%H:%M:%S` UPTIME >> /conf/ppp-up.{$dev}.log\"\n";
$rclinkdown .= " ! sh -c \"/etc/rc.conf_mount_ro\"\n";
+ $rclinkdown .= " ! sh -c \"/bin/rm -f /var/run/{$dev}.if\"\n";
}
}
@@ -2353,11 +2354,10 @@ function get_real_interface($interface = "wan") {
$dev = $config['interfaces'][$if]['serialport'];
if(file_exists("/var/run/{$dev}.if")) {
$wanif = trim(file_get_contents("/var/run/{$dev}.if"));
- break;
- } else {
- $wanif = $dev;
- break;
- }
+ } else
+ $wanif = "Not connected";
+
+ break;
}
$cfg = $config['interfaces'][$if];
OpenPOWER on IntegriCloud