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

Use getaddrinfo instead of gethostbyname (fixes #3156) #3159

Merged
merged 1 commit into from
Mar 6, 2023
Merged

Conversation

lminiero
Copy link
Member

@lminiero lminiero commented Feb 1, 2023

As the title says, this patch gets rid of the few places where we were still using gethostbyname (AudioBridge, SIP and NoSIP plugins) in order to use getaddrinfo instead, which we were already using in other places. This addresses issue #3156 which is where this was pointed out.

That said, this patch may have some implications that is worth investigating. In fact, the main point of getaddrinfo is that it makes it easier to use IPv6 as well, rather than stick to IPv4 which is what those plugins were doing, but this means we now use IPv6 sockets whether it will actually be v6 or not (so with IPV6_V6ONLY set to 0, via setsockopt). This is something we did with forwarders too, but in the past we figured out this could actually be problematic, e.g., on MacOS or systems that have IPv6 entirely disabled. As such, I'll have to probably add some tweaks to the current patch so that we create the socket with a specific family, maybe depending on the local_ip the plugins are using (still not sure).

Apart from this, simple functional tests (using IPv4 addresses) seemed to still work fine in both SIP and NoSIP plugins (I haven't tested plain RTP participation in the AudioBridge yet with this changes). If you use any of those plugins for RTP usage, you're strongly encouraged to test this PR, so that you're not caught by surprise if any regression we didn't anticipate shows up in your deployments.

@lminiero lminiero marked this pull request as ready for review February 1, 2023 16:18
@lminiero lminiero added the multistream Related to Janus 1.x label Feb 1, 2023
@lminiero
Copy link
Member Author

lminiero commented Mar 6, 2023

Since we received no feedback, I'll merge as it is. In case it turns out this causes problems in some environments, we'll address them later on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multistream Related to Janus 1.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant