-
Notifications
You must be signed in to change notification settings - Fork 130
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
AddSet IPv4 wrong byte order on Ubuntu 22.04 #225
Comments
+1 Was about to open the same exact issue, I have reversed IPs in my set too 👍
|
Thanks for the report. Pull requests with bugfixes welcome (I don’t have time to look into this issue myself, but maybe some other contributor does…) |
Hi to all, here is the code responsible for this: Lines 563 to 571 in b18665a
I've checked debug messages for both your provided code and standard nft commands.
Please give me a few more days to research this, the above code should quickly fix your issue. |
Some dirty fix for ipv4 (I will do ipv6 later) to revert the revert 🙃
I needed to add dynamically in set IP (so constant was not a solution in my case) :) |
It looks like intervals are broken, too. At least I could not set any ipv4 interval. |
Fixes google#225 Introduced KeyByteOrder in sets which fills UDATA with endianess information
Hi all, I've looked into this further and this is what I think is the root cause: PR #180 was implemented to conform to the main nftables C implementation and it seemed that it fixed one small issue pointed out in #177. This change makes sense, but lib users cannot easily instruct nftables which endianess to use except by using current bool flags found in I have introduced This approach also conforms to main nftables C implementation:
Feel free to test the PR branch and let me know whether it fixes your issue. |
After debugging, I found that the intervals worked. I just didn't understand the KeyEnd attribute correctly. Actually KeyEnd is not used to set the interval, instead I had to add 2 elements (first and last). Here is the correct example:
Result:
|
Thank you for the fix it's perfect ! |
I am trying to add a set with ipv4 addresses, but the ip address bytes are reversed. Here is my code:
But the result is:
Some additional information:
The text was updated successfully, but these errors were encountered: