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

IPv6 implementation #4

Open
alberk8 opened this issue Dec 24, 2015 · 13 comments
Open

IPv6 implementation #4

alberk8 opened this issue Dec 24, 2015 · 13 comments

Comments

@alberk8
Copy link

alberk8 commented Dec 24, 2015

Hi,
Is there any progress in the IPv6 implementation? Thank you.

@hamishforbes
Copy link
Owner

Hi,
Unfortunately not, I don't have a need for an ipv6 version yet myself so its hard to prioritise that work.
Pull requests are most welcome though!

@GUI
Copy link
Contributor

GUI commented Jan 20, 2016

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.

@hamishforbes
Copy link
Owner

Cool!
Yeah I think i'll leave this lib as a pure Lua version, if people don't mind the dependency they can use your libcidr based one.

If you don't mind I'll link to your repo on the README here?

@GUI
Copy link
Contributor

GUI commented Jan 21, 2016

👍 Sounds good. And feel free to add a link--thanks!

@GUI
Copy link
Contributor

GUI commented Jan 21, 2016

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.

@hamishforbes
Copy link
Owner

👍 cool, IPv6 is on the roadmap for the dayjob this year so maybe i'll find time to add a pure Lua version then :)

@joshenders
Copy link

Hi @hamishforbes ever find time to add this?

@hamishforbes
Copy link
Owner

No sorry, not yet.

@joshenders
Copy link

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?

@hamishforbes
Copy link
Owner

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.

@GUI
Copy link
Contributor

GUI commented Jan 25, 2017

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:

@joshenders
Copy link

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.

@bungle
Copy link

bungle commented Mar 23, 2017

I recently forked mediador library here:
https://github.com/mashape/lua-resty-mediador

It does support IPv6 and IPv4. Haven't benchmarked it yet.

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

5 participants