diff options
author | jim-p <jimp@pfsense.org> | 2011-05-20 12:05:18 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2011-05-20 12:05:18 -0400 |
commit | f69d8346d56e2f4de405c9cedf316bccf453f1b0 (patch) | |
tree | 9c67684dc44134508e660960f693e49122b08856 /etc | |
parent | e4aa1eaed439b9732a14dc177d9a70c0de0ade8e (diff) | |
parent | abcdca835cbce83d72d70bb957bbbf2118ae3d01 (diff) | |
download | pfsense-f69d8346d56e2f4de405c9cedf316bccf453f1b0.zip pfsense-f69d8346d56e2f4de405c9cedf316bccf453f1b0.tar.gz |
Merge remote branch 'upstream/master'
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/filter.inc | 21 | ||||
-rw-r--r-- | etc/inc/pfsense-utils.inc | 18 | ||||
-rwxr-xr-x | etc/rc.linkup | 2 |
3 files changed, 27 insertions, 14 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 2404a23..f5907c1 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -532,7 +532,7 @@ function filter_generate_aliases() { /* Setup pf groups */ if(isset($config['aliases']['alias'])) { foreach ($config['aliases']['alias'] as $aliased) { - $extraalias = ""; + $extralias = ""; /* * XXX: i am not sure what this does so i am commenting it out for now, because as it is * its quite dangerous! @@ -542,7 +542,10 @@ function filter_generate_aliases() { $aliasnesting = array(); $aliasaddrnesting = array(); $addrlist = filter_generate_nested_alias($aliased['name'], $aliased['address'], $aliasnesting, $aliasaddrnesting); - if($aliased['type'] == "host" || $aliased['type'] == "network" || $aliased['type'] == "url") { + switch ($aliased['type']) { + case "host": + case "network": + case "url": $tableaddrs = "{$addrlist}{$extralias}"; if(empty($tableaddrs)) $aliases .= "table <{$aliased['name']}> persist\n"; @@ -550,7 +553,8 @@ function filter_generate_aliases() { $aliases .= "table <{$aliased['name']}> { {$addrlist}{$extralias} } \n"; $aliases .= "{$aliased['name']} = \"<{$aliased['name']}>\"\n"; - } else if($aliased['type'] == "openvpn") { + break; + case "openvpn": $openvpncfg = array(); if($config['openvpn']['user']) { /* XXX: Check if we have a correct ip? */ @@ -570,14 +574,21 @@ function filter_generate_aliases() { } $aliases .= "table <{$aliased['name']}> { {$newaddress}{$extralias} } \n"; $aliases .= "{$aliased['name']} = \"<{$aliased['name']}>\"\n"; - } elseif($aliased['type'] == "urltable") { + break; + case "urltable": $urlfn = alias_expand_urltable($aliased['name']); if ($urlfn) { $aliases .= "table <{$aliased['name']}> persist file \"{$urlfn}\"\n"; $aliases .= "{$aliased['name']} = \"<{$aliased['name']}>\"\n"; } - } else + break; + case "port": + $aliases .= "{$aliased['name']} = \"{ {$addrlist} }\"\n"; + break; + default: $aliases .= "{$aliased['name']} = \"{ {$aliased['address']}{$extralias} }\"\n"; + break; + } } } $result = "{$alias} \n"; diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 5487227..41bf690 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -708,14 +708,14 @@ function call_pfsense_method($method, $params, $timeout = 0) { $proxyport = 0; $proxyuser = ""; $proxypass = ""; - if (!empty($config['system']['httpproxy'])) - $proxyurl = $config['system']['httpproxy']; - if (!empty($config['system']['httpproxyport']) && is_numeric($config['system']['httpproxyport'])) - $proxyport = $config['system']['httpproxyport']; - if (!empty($config['system']['httpproxyuser'])) - $proxyuser = $config['system']['httpproxyuser']; - if (!empty($config['system']['httpproxypass'])) - $proxypass = $config['system']['httpproxypass']; + if (!empty($config['system']['proxyurl'])) + $proxyurl = $config['system']['proxyurl']; + if (!empty($config['system']['proxyport']) && is_numeric($config['system']['proxyport'])) + $proxyport = $config['system']['proxyport']; + if (!empty($config['system']['proxyuser'])) + $proxyuser = $config['system']['proxyuser']; + if (!empty($config['system']['proxypass'])) + $proxypass = $config['system']['proxypass']; $cli = new XML_RPC_Client($xmlrpc_path, $xmlrpc_base_url, $port, $proxyurl, $proxyport, $proxyuser, $proxypass); // If the ALT PKG Repo has a username/password set, use it. if($config['system']['altpkgrepo']['username'] && @@ -1498,7 +1498,7 @@ function download_file_with_progress_bar($url_file, $destination_file, $readbody curl_setopt($ch, CURLOPT_PROXYPORT, $config['system']['proxyport']); if (!empty($config['system']['proxyuser']) && !empty($config['system']['proxypass'])) { @curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_ANY | CURLAUTH_ANYSAFE); - curl_setopt($ch, CURLOPT_PROXYUSERPASS, "{$config['system']['proxyuser']}:{$config['system']['proxypass']}"); + curl_setopt($ch, CURLOPT_PROXYUSERPWD, "{$config['system']['proxyuser']}:{$config['system']['proxypass']}"); } } diff --git a/etc/rc.linkup b/etc/rc.linkup index 2e8bbcd..ea0fb90 100755 --- a/etc/rc.linkup +++ b/etc/rc.linkup @@ -45,6 +45,8 @@ function handle_argument_group($iface, $argument2) { $iface = get_real_interface($iface); interfaces_bring_up($iface); exec("/usr/sbin/arp -d -i {$iface} -a"); + if ($argument2 == "start" || $argument2 == "up") + send_event("interface newip {$iface}"); } else { switch ($argument2) { case "stop": |