Giter Site home page Giter Site logo

Please support IPv6 about gild HOT 8 CLOSED

xvxx avatar xvxx commented on September 2, 2024 1
Please support IPv6

from gild.

Comments (8)

kseistrup avatar kseistrup commented on September 2, 2024 2

Works like a charm! 👏

from gild.

xvxx avatar xvxx commented on September 2, 2024 1

Yes this would be great. Now that Gild is using https://github.com/dvkt/ldpl-socket I will look into adding IPv6 support to that package.

from gild.

kseistrup avatar kseistrup commented on September 2, 2024 1

why do you need IPv6 support?

I don't personally need IPv6 support as such, but every piece of networking software in 2019 ought to support IPv6.

If a piece of software (that supports IPv6) gets an IPv4 and an IPv6 address when looking up the IP address of a host, it will generally choose the IPv6 address (on Linux according to /etc/gai.conf), and generally – at least in my experience – nothing needs be done socket-wise.

It seems (from ldpl_socket.cpp) that gild is using gethostbyname() to look up a host address. The gethostbyname(3) on my box says that (1) it will return an IPv4 address, and (2) that the function is obsolete and that getaddrinfo(3) should be used instead: getaddrinfo() will use whichever kind of IP address is available:

The getaddrinfo() function combines the functionality provided by the gethostbyname(3) and getservbyname(3) functions into a single interface, but unlike the latter functions, getaddrinfo() is reentrant and allows programs to eliminate IPv4-versus-IPv6 dependencies.

Sounds like this is an easy fix.

from gild.

xvxx avatar xvxx commented on September 2, 2024 1

@kseistrup Great, thanks for the tip about getaddrinfo()! I've updated https://github.com/dvkt/ldpl-socket to support both IPv4 and IPv6, and I've pushed a new release of Gild with support. I'm sure there are still some kinks in it so please let me know if anything isn't working. Thank you!

from gild.

Lartu avatar Lartu commented on September 2, 2024 1

I didn't know all that about IPv6, @kseistrup, thank you for telling me!

from gild.

Lartu avatar Lartu commented on September 2, 2024

@kseistrup I'm intrigued, why do you need IPv6 support? Are you trying to connect to an IPv6 address or trying to connect from an IPv6 address? Have you faced any errors?

This may sound strange, but I have never come across an IPv6 address (that I know of), so I'd like to know the use cases so we can support them better.

from gild.

kseistrup avatar kseistrup commented on September 2, 2024

PS:

I have never come across an IPv6 address (that I know of)

If your device doesn't have an IPv6 address, you most likely haven't. But my devices will get both an IPv4 and an IPv6 address from the router and will favour IPv6 connections over IPv4 ditto.

Even if you don't get IPv6 from your ISP, you may at least have IPv6 on your loopback interface:

$ ifconfig lo
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 16206  bytes 1812911 (1.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 16206  bytes 1812911 (1.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

where ::1 is the IPv6 equivalent of 127.0.0.1.

from gild.

kseistrup avatar kseistrup commented on September 2, 2024

Sweet! I've just gone to bed, but I'll try the new version tomorrow. Thanks!

from gild.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.