Permalink
Browse files

TCP flags are valid on any type of rule, don't skip them on block or …

…reject rules
  • Loading branch information...
1 parent df78d8c commit e8ddd3a89a4513ab135c88739bd86cbb9fcd92c2 Chris Buechler committed Jun 15, 2013
Showing with 29 additions and 29 deletions.
  1. +29 −29 etc/inc/filter.inc
View
@@ -2257,37 +2257,37 @@ function filter_generate_user_rule($rule) {
if ($type == "pass") {
if (isset($rule['allowopts']))
$aline['allowopts'] = " allow-opts ";
-
- $aline['flags'] = "";
- if ($rule['protocol'] == "tcp") {
- if (isset($rule['tcpflags_any']))
- $aline['flags'] = "flags any ";
- else if (!empty($rule['tcpflags2'])) {
- $aline['flags'] = "flags ";
- if (!empty($rule['tcpflags1'])) {
- $flags1 = explode(",", $rule['tcpflags1']);
- 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 ($rule['protocol'] == "tcp") {
+ if (isset($rule['tcpflags_any']))
+ $aline['flags'] = "flags any ";
+ else if (!empty($rule['tcpflags2'])) {
+ $aline['flags'] = "flags ";
+ if (!empty($rule['tcpflags1'])) {
+ $flags1 = explode(",", $rule['tcpflags1']);
+ 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) {
- // CWR flag needs special treatment
- if($flag2[0] == "c")
- $aline['flags'] .= "W";
- else
- $aline['flags'] .= strtoupper($flag2[0]);
- }
+ }
+ $aline['flags'] .= "/";
+ if (!empty($rule['tcpflags2'])) {
+ $flags2 = explode(",", $rule['tcpflags2']);
+ 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
- $aline['flags'] = "flags S/SA ";
+ }
+ $aline['flags'] .= " ";
+ } else {
+ $aline['flags'] = "flags S/SA ";
}
/*

0 comments on commit e8ddd3a

Please sign in to comment.