diff options
author | Renato Botelho <garga@FreeBSD.org> | 2015-03-16 08:17:03 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2015-03-16 08:17:03 -0300 |
commit | b78655a9cf9cdafb4998b30fb3894bd6c262ea96 (patch) | |
tree | 0223d57ad9b22bf0ff90264bdb00008fb0fbfede /usr/local/bin/easyrule | |
parent | aa77c7baf2020c4de1a4ae5db8b587a5a7c14bb8 (diff) | |
parent | 7d61beba45e06f4be2fc5436f14e879ec7dd2675 (diff) | |
download | pfsense-b78655a9cf9cdafb4998b30fb3894bd6c262ea96.zip pfsense-b78655a9cf9cdafb4998b30fb3894bd6c262ea96.tar.gz |
Merge pull request #1562 from phil-davis/usr-review1
Diffstat (limited to 'usr/local/bin/easyrule')
-rwxr-xr-x | usr/local/bin/easyrule | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/usr/local/bin/easyrule b/usr/local/bin/easyrule index 9850aee..f00a7cb 100755 --- a/usr/local/bin/easyrule +++ b/usr/local/bin/easyrule @@ -10,11 +10,11 @@ modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -50,29 +50,32 @@ function pconfig_to_address(&$adr, $padr, $pmask, $pnot=false, $pbeginport=0, $p $adr = array(); - if ($padr == "any") + if ($padr == "any") { $adr['any'] = true; - else if (is_specialnet($padr)) + } else if (is_specialnet($padr)) { $adr['network'] = $padr; - else { + } else { $adr['address'] = $padr; - if ($pmask != 32) + if ($pmask != 32) { $adr['address'] .= "/" . $pmask; + } } - if ($pnot) + if ($pnot) { $adr['not'] = true; - else + } else { unset($adr['not']); + } if (($pbeginport != 0) && ($pbeginport != "any")) { - if ($pbeginport != $pendport) + if ($pbeginport != $pendport) { $adr['port'] = $pbeginport . "-" . $pendport; - else + } else { $adr['port'] = $pbeginport; + } } - if(is_alias($pbeginport)) { + if (is_alias($pbeginport)) { $adr['port'] = $pbeginport; } } @@ -81,12 +84,14 @@ function pconfig_to_address(&$adr, $padr, $pmask, $pnot=false, $pbeginport=0, $p function is_specialnet($net) { global $specialsrcdst; - if(!$net) + if (!$net) { return false; - if (in_array($net, $specialsrcdst)) + } + if (in_array($net, $specialsrcdst)) { return true; - else + } else { return false; + } } |