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

ipsplit tests fails due to endianess #250

Open
jelu opened this issue Nov 21, 2024 · 4 comments
Open

ipsplit tests fails due to endianess #250

jelu opened this issue Nov 21, 2024 · 4 comments

Comments

@jelu
Copy link
Member

jelu commented Nov 21, 2024

@nicki-krizek can you fix ipsplit tests using overwrite or make overwrite handle endianess correctly?

They fail on other endian systems such as s390x:
https://bugzilla.redhat.com/show_bug.cgi?id=2323980#c7

@nicki-krizek
Copy link
Contributor

Heh, I actually found a note about this issue when I wrote these tests a few years back: https://github.com/DNS-OARC/dnsjit/blob/develop/src/test/test_ipsplit.lua#L2

This doesn't matter for the ipsplit filter functionality (as noted in the docs, the bytes are written in host order).

On BE-platform, I'd recommend disabling / commenting out the related checks if needed, or just skipping the ipsplit test. IMO this is not worth fixing. It could be commented out in the upstream test suite if you insist.

@jelu
Copy link
Member Author

jelu commented Nov 26, 2024 via email

@nicki-krizek
Copy link
Contributor

The overwrite is to create a sequential 4 byte client ID for each unique input address. This is then used in shotgun which keeps track of each of those clients and has to have a memory structure allocated for each of them. This client ID then basically serves as an index into the allocated array. The reason it's done in ipsplit is because it's more efficient to do this when pre-processing the data, rather than trying to do this mapping at shotgun runtime.

In practice, the byte order doesn't matter as long as you don't attempt to use the pre-processed data from BE platform to run shotgun on LE platform.

It could be fixed to always be consistent. The other part that does the decoding which would have to be adjusted is in https://gitlab.nic.cz/knot/shotgun/-/blob/master/replay/dnssim/src/output/dnssim.c#L176

@jelu
Copy link
Member Author

jelu commented Nov 28, 2024 via email

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

No branches or pull requests

2 participants