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

Filter out unresolved addresses when parsing resolv.conf #13614

Merged
merged 2 commits into from Sep 19, 2023
Merged

Conversation

normanmaurer
Copy link
Member

Motivation:

We need to filter out unresolved addresses when parsing resolv.conf as otherwise we might throw an exception while initialize the default address provider.

Modifications:

Only add address when its resolvable

Result:

Fixes #13612

Copy link
Contributor

@chrisvest chrisvest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one thing

// address is used with a scope that represent a network interface that does not exists
// on the host.
if (!addr.isUnresolved()) {
addresses.add(SocketUtils.socketAddress(maybeIP, port));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can reuse the addr variable here, instead of recreating the InetSocketAddress object.

Motivation:

We need to filter out unresolved addresses when parsing resolv.conf as otherwise we might throw an exception while initialize the default address provider.

Modifications:

Only add address when its resolvable

Result:

Fixes #13612
@normanmaurer normanmaurer merged commit 4e17ab6 into 4.1 Sep 19, 2023
5 of 12 checks passed
@normanmaurer normanmaurer deleted the resolv_conf branch September 19, 2023 10:15
normanmaurer added a commit that referenced this pull request Sep 19, 2023
Motivation:

We need to filter out unresolved addresses when parsing resolv.conf as
otherwise we might throw an exception while initialize the default
address provider.

Modifications:

Only add address when its resolvable

Result:

Fixes #13612
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.

Error parsing IPv6 interface Unix resolv.conf
2 participants