summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim P <jim@pingle.org>2012-10-01 08:04:07 -0700
committerJim P <jim@pingle.org>2012-10-01 08:04:07 -0700
commit6646c0f96fa74c4d4aafc971e277a33081f855ef (patch)
tree66064a730eada4f06c6f8f099ed5b67263848d02
parentb4147482efca1524c423df5219e612332444e540 (diff)
parentdcbafe17d2f7429b18e275195c3ed5e659250f76 (diff)
downloadpfsense-6646c0f96fa74c4d4aafc971e277a33081f855ef.zip
pfsense-6646c0f96fa74c4d4aafc971e277a33081f855ef.tar.gz
Merge pull request #233 from bcyrill/rfc3168_flags
Add ECE and CWR TCP flags as defined in RFC 3168
-rw-r--r--etc/inc/filter.inc18
-rw-r--r--etc/inc/globals.inc2
-rwxr-xr-xusr/local/www/guiconfig.inc2
3 files changed, 16 insertions, 6 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index c62bba5..c94a6f2 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -2200,14 +2200,24 @@ function filter_generate_user_rule($rule) {
$aline['flags'] = "flags ";
if (!empty($rule['tcpflags1'])) {
$flags1 = explode(",", $rule['tcpflags1']);
- foreach ($flags1 as $flag1)
- $aline['flags'] .= strtoupper($flag1[0]);
+ foreach ($flags1 as $flag1) {
+ // CWR flag needs special treatment
+ if($flag1[0] == "c")
+ $aline['flags'] .= "W";
+ else
+ $aline['flags'] .= strtoupper($flag1[0]);
+ }
}
$aline['flags'] .= "/";
if (!empty($rule['tcpflags2'])) {
$flags2 = explode(",", $rule['tcpflags2']);
- foreach ($flags2 as $flag2)
- $aline['flags'] .= strtoupper($flag2[0]);
+ foreach ($flags2 as $flag2) {
+ // CWR flag needs special treatment
+ if($flag2[0] == "c")
+ $aline['flags'] .= "W";
+ else
+ $aline['flags'] .= strtoupper($flag2[0]);
+ }
}
$aline['flags'] .= " ";
} else
diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc
index 51fbc22..b5c4eee 100644
--- a/etc/inc/globals.inc
+++ b/etc/inc/globals.inc
@@ -100,7 +100,7 @@ $g = array(
$iptos = array("lowdelay", "throughput", "reliability");
/* TCP flags */
-$tcpflags = array("syn", "ack", "fin", "rst", "psh", "urg");
+$tcpflags = array("syn", "ack", "fin", "rst", "psh", "urg", "ece", "cwr");
if(file_exists("/etc/platform")) {
$arch = php_uname("m");
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc
index 243232b..5959b15 100755
--- a/usr/local/www/guiconfig.inc
+++ b/usr/local/www/guiconfig.inc
@@ -219,7 +219,7 @@ $wkports = array(
5900 => "VNC");
/* TCP flags */
-$tcpflags = array("fin", "syn", "rst", "psh", "ack", "urg");
+$tcpflags = array("fin", "syn", "rst", "psh", "ack", "urg", "ece", "cwr");
$specialnets = array("pptp" => "PPTP clients", "pppoe" => "PPPoE clients", "l2tp" => "L2TP clients");
OpenPOWER on IntegriCloud