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

community-id: Fix IPv6 address sorting not respecting byte order v2 #9442

Conversation

catenacyber
Copy link
Contributor

Link to redmine ticket:
https://redmine.openinfosecfoundation.org/issues/6276

Describe changes:
When comparing IPv6 addresses based on uint32_t chunks, one needs to apply ntohl() conversion to the individual parts, otherwise on little endian systems individual bytes are compared in the wrong order. Avoid this all and leverage memcmp(), it'll short circuit on the first differing byte and its return values tells us which address sorts lower.

Provide values to any of the below to override the defaults.

OISF/suricata-verify#1360

SV_BRANCH=pr/1360

#9399 rebased with ticket number in commit

awelzel and others added 2 commits September 6, 2023 11:39
When comparing IPv6 addresses based on uint32_t chunks, one needs to
apply ntohl() conversion to the individual parts, otherwise on little
endian systems individual bytes are compared in the wrong order.
Avoid this all and leverage memcmp(), it'll short circuit on the first
differing byte and its return values tells us which address sorts lower.

Bug: OISF#6276
@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 15845

@victorjulien victorjulien merged commit e65c052 into OISF:master Sep 7, 2023
@victorjulien
Copy link
Member

Merged in #9449, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants