summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-03-30 21:19:33 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-03-30 21:19:33 +0000
commite4913b90258e462ae9d74f872dfa288874cd9ca4 (patch)
tree522a06d55d277a4c240ff9b653de1fb0e0fb48f6 /etc
parent6df4e01c541ff11106893789bc3af66d35d10de6 (diff)
downloadpfsense-e4913b90258e462ae9d74f872dfa288874cd9ca4.zip
pfsense-e4913b90258e462ae9d74f872dfa288874cd9ca4.tar.gz
Handle port ranges correctly
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/pfsense-utils.inc16
1 files changed, 6 insertions, 10 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 6ae6486..41af90e 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -339,13 +339,11 @@ function tdr_create_ipfw_rule($rule, $type) {
} else if (($srcport[0] == 1) && ($srcport[1] == 65535)) {
/* no need for a port statement here */
} else if ($srcport[1] == 65535) {
- $aline['srcport'] = "port >= {$srcport[0]} ";
+ $aline['srcport'] = ">={$srcport[0]} ";
} else if ($srcport[0] == 1) {
- $aline['srcport']= "port <= {$srcport[1]} ";
+ $aline['srcport']= "<={$srcport[1]} ";
} else {
- $srcport[0]--;
- $srcport[1]++;
- $aline['srcport'] = "port {$srcport[0]} >< {$srcport[1]} ";
+ $aline['srcport'] = "{$srcport[0]}-{$srcport[1]} ";
}
}
}
@@ -441,13 +439,11 @@ function tdr_create_ipfw_rule($rule, $type) {
} else if (($dstport[0] == 1) && ($dstport[1] == 65535)) {
/* no need for a port statement here */
} else if ($dstport[1] == 65535) {
- $aline['dstport'] = "port >= {$dstport[0]} ";
+ $aline['dstport'] = ">= {$dstport[0]} ";
} else if ($dstport[0] == 1) {
- $aline['dstport'] = "port <= {$dstport[1]} ";
+ $aline['dstport'] = "<= {$dstport[1]} ";
} else {
- $dstport[0]--;
- $dstport[1]++;
- $aline['dstport'] = "port {$dstport[0]} >< {$dstport[1]} ";
+ $aline['dstport'] = "{$dstport[0]}-{$dstport[1]} ";
}
}
}
OpenPOWER on IntegriCloud