mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
Fix "!=" operator for subnets
Fixed a bug where the "!=" operator with subnet operands was treated the same as the "==" operator.
This commit is contained in:
parent
a10093b620
commit
9357aeb6b1
1 changed files with 5 additions and 4 deletions
|
@ -871,11 +871,12 @@ Val* BinaryExpr::SubNetFold(Val* v1, Val* v2) const
|
|||
{
|
||||
const IPPrefix& n1 = v1->AsSubNet();
|
||||
const IPPrefix& n2 = v2->AsSubNet();
|
||||
bool result = ( n1 == n2 ) ? true : false;
|
||||
|
||||
if ( n1 == n2 )
|
||||
return new Val(1, TYPE_BOOL);
|
||||
else
|
||||
return new Val(0, TYPE_BOOL);
|
||||
if ( tag == EXPR_NE )
|
||||
result = !result;
|
||||
|
||||
return new Val(result, TYPE_BOOL);
|
||||
}
|
||||
|
||||
void BinaryExpr::SwapOps()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue