Skip to content

Commit

Permalink
TCP flags are valid on any type of rule, don't skip them on block or …
Browse files Browse the repository at this point in the history
…reject rules
  • Loading branch information
Chris Buechler committed Jun 15, 2013
1 parent df78d8c commit e8ddd3a
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions etc/inc/filter.inc
Expand Up @@ -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 ";
}

/*
Expand Down

0 comments on commit e8ddd3a

Please sign in to comment.