Revision 35e125b4
Added by Jim Pingle almost 12 years ago
etc/inc/easyrule.inc | ||
---|---|---|
71 | 71 |
return false; |
72 | 72 |
} |
73 | 73 |
|
74 |
function easyrule_block_rule_exists($int = 'wan') { |
|
74 |
function easyrule_block_rule_exists($int = 'wan', $ipproto = "inet") {
|
|
75 | 75 |
global $blockaliasname, $config; |
76 | 76 |
/* No rules, we we know it doesn't exist */ |
77 | 77 |
if (!is_array($config['filter']['rule'])) { |
... | ... | |
82 | 82 |
foreach ($config['filter']['rule'] as $rule) { |
83 | 83 |
if (!is_array($rule) || !is_array($rule['source'])) |
84 | 84 |
continue; |
85 |
if ($rule['source']['address'] == $blockaliasname . strtoupper($int) && ($rule['interface'] == $int) && ($rule['ipprotocol'] == $ipproto)) |
|
85 |
$checkproto = isset($rule['ipprotocol']) ? $rule['ipprotocol'] : "inet"; |
|
86 |
if ($rule['source']['address'] == $blockaliasname . strtoupper($int) && ($rule['interface'] == $int) && ($checkproto == $ipproto)) |
|
86 | 87 |
return true; |
87 | 88 |
} |
88 | 89 |
return false; |
Also available in: Unified diff
Fixup check for existing easyrule block rule to account for the ipproto and when the ipproto is blank.