Skip to content

fix: support binding an ipv6 address#75

Merged
jvdprng merged 1 commit intotrailofbits:mainfrom
Julien00859:Julien00859/ipv6
Oct 24, 2025
Merged

fix: support binding an ipv6 address#75
jvdprng merged 1 commit intotrailofbits:mainfrom
Julien00859:Julien00859/ipv6

Conversation

@Julien00859
Copy link
Copy Markdown
Contributor

closes #68

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Oct 22, 2025

CLA assistant check
All committers have signed the CLA.

@Julien00859
Copy link
Copy Markdown
Contributor Author

I also tried the following to save up the dns request:

def family_ip(address):
    try:
        ipaddress.IPv4Address(address)
        return socket.AF_INET
    except ipaddress.AddressValueError:
        try:
            ipaddress.IPv6Address(address)
            return socket.AF_INET6
        except ipaddress.AddressValueError:
            return socket.getaddrinfo(address, 0, type=socket.SOCK_STREAM)[0][0]

But it was slower than doing always the dns request

The CLA assistant is super cool btw :D

@jvdprng jvdprng merged commit 2a8370f into trailofbits:main Oct 24, 2025
1 of 2 checks passed
@jvdprng
Copy link
Copy Markdown
Member

jvdprng commented Oct 24, 2025

Thanks, just one lint issue but I can fix it!

@Julien00859
Copy link
Copy Markdown
Contributor Author

Sorry for the lint issue, we use single-quote-for-technical-string at work and I totally forgot that the rest of the world agrees on using double quotes everywhere. I'll pay attention for future PRs!

@Julien00859 Julien00859 deleted the Julien00859/ipv6 branch October 24, 2025 23:06
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

Successfully merging this pull request may close these issues.

Cannot bind ipv6 address

3 participants