-
Notifications
You must be signed in to change notification settings - Fork 84
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
IPv6 implementation #4
Comments
Hi, |
If it helps, here's a slightly different Lua library I put together that supports IPv6 and CIDR comparisons (as well as IPv4): https://github.com/GUI/lua-libcidr-ffi The downside is that it requires libcidr to be installed on the system, and the API is probably a bit more raw that what resty-iputils provides. I had originally looked to add IPv6 compatibility to resty-iputils directly, but I couldn't find a good way to efficiently compare IPv6 CIDR ranges in pure Lua (I found a couple different implementations in other open source projects, but their performance wasn't ideal). So I ended up writing the small FFI wrapper around libcidr (which is what does the real work). It would be possible to leverage the libcidr-ffi library in resty-iputils for IPv6 compatibility, but that would mean making libcidr a dependency, and I'm not sure if that's desirable. |
Cool! If you don't mind I'll link to your repo on the README here? |
👍 Sounds good. And feel free to add a link--thanks! |
Good deal. I've also added a link back to lua-resty-iputils from lua-libcidr-ffi's README. Hopefully that will help people find the library that best fits their needs regardless of which one they stumble into first. |
👍 cool, IPv6 is on the roadmap for the dayjob this year so maybe i'll find time to add a pure Lua version then :) |
Hi @hamishforbes ever find time to add this? |
No sorry, not yet. |
I might me able to pick this up. Is there benefit in a pure lua implementation or would it make more sense to extend lua-libcidr-ffi to be more user-friendly? |
The main benefit is fewer dependencies, you don't need libcidr installed on the system for the pure Lua version. There might be performance differences, one way or the other, but I haven't benchmarked them. |
Yeah, libcidr also isn't a particularly common system dependency (I don't think there's Ubuntu or CentOS packages for it), so while I've found lua-libcidr-ffi useful for systems I can manually install libcidr on, I also agree that something with fewer dependencies is nice. If it helps anyone looking at pure Lua options, here's some more specific details about the alternatives I found before building lua-libcidr-ffi:
|
That's funny, I was looking at luci as well. We have a need for IPv6 support in our environment at Pinterest. If we take this on, it'll probably be in Q2. I'll make sure we contribute this back; seems like this is sorely needed. |
I recently forked mediador library here: It does support IPv6 and IPv4. Haven't benchmarked it yet. |
Hi,
Is there any progress in the IPv6 implementation? Thank you.
The text was updated successfully, but these errors were encountered: