diff options
author | Jim P <jim@pingle.org> | 2012-10-01 08:04:07 -0700 |
---|---|---|
committer | Jim P <jim@pingle.org> | 2012-10-01 08:04:07 -0700 |
commit | 6646c0f96fa74c4d4aafc971e277a33081f855ef (patch) | |
tree | 66064a730eada4f06c6f8f099ed5b67263848d02 /etc | |
parent | b4147482efca1524c423df5219e612332444e540 (diff) | |
parent | dcbafe17d2f7429b18e275195c3ed5e659250f76 (diff) | |
download | pfsense-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
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/filter.inc | 18 | ||||
-rw-r--r-- | etc/inc/globals.inc | 2 |
2 files changed, 15 insertions, 5 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"); |