Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cidr bug fixes #131

Merged
merged 2 commits into from
Nov 23, 2023
Merged

Cidr bug fixes #131

merged 2 commits into from
Nov 23, 2023

Conversation

jonessha
Copy link
Contributor

Description of changes:

There were two bugs with CIDR:

  1. When an IP pattern was present and the incoming value was also an IP, we would convert the IP to a hex string before performing matching. Problem with this was that if there was also a rule present that used anything-but on this same field, the anything-but would always be satisfied, since the anything-but does not specify our internal hex format.
  2. When both a CIDR pattern and a numeric pattern were present and the incoming value was an IP, we would attempt to convert to a numeric value first, which would fail, and cause us to skip over CIDR matching and go straight to String matching.

Benchmark / Performance (for source code changes):

EXACT events/sec: 169505.2
WILDCARD events/sec: 127968.8
PREFIX events/sec: 166981.2
PREFIX_EQUALS_IGNORE_CASE_RULES events/sec: 177113.9
SUFFIX events/sec: 190579.6
SUFFIX_EQUALS_IGNORE_CASE_RULES events/sec: 194051.0
EQUALS_IGNORE_CASE events/sec: 174075.2
NUMERIC events/sec: 115359.0
ANYTHING-BUT events/sec: 126524.9
ANYTHING-BUT-IGNORE-CASE events/sec: 115109.7
ANYTHING-BUT-PREFIX events/sec: 128509.0
ANYTHING-BUT-SUFFIX events/sec: 130716.6
COMPLEX_ARRAYS events/sec: 30098.6
PARTIAL_COMBO events/sec: 51279.9
COMBO events/sec: 19901.7

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@timbray
Copy link
Collaborator

timbray commented Nov 23, 2023

Hey, those are my bugs you're killing.

@baldawar baldawar merged commit 097b889 into main Nov 23, 2023
3 checks passed
@jonessha jonessha deleted the cidr_bug_fixes branch November 23, 2023 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants