feat: add prefer_ipv4 option to force IPv4 for DNS resolution and connections#357
Open
guessi wants to merge 1 commit into
Open
feat: add prefer_ipv4 option to force IPv4 for DNS resolution and connections#357guessi wants to merge 1 commit into
guessi wants to merge 1 commit into
Conversation
…nections Add a new prefer_ipv4 = false config option (efs-utils.conf and s3files-utils.conf) that, when set to true, forces IPv4 throughout the mount path: - DNS name resolution uses AF_INET instead of AF_UNSPEC - CNAME resolution in match_device uses AF_INET - Fallback to IPv6-only mount target raises FallbackException - efs-proxy resolves mount target hostname to IPv4 before connecting - efs-proxy config receives prefer_ipv4 = true when enabled Default is false so existing behaviour is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #356
Problem
On dual-stack or NAT64 hosts, DNS returns IPv6 addresses before IPv4. efs-utils uses
AF_UNSPEC, so the OS selects the IPv6 address, which times out on NFS port 2049 because the EFS mount target is only reachable over IPv4.Change
Adds
prefer_ipv4 = false(off by default) toefs-utils.confands3files-utils.conf. When set totrue:AF_INETinstead ofAF_UNSPEC(Python layer)match_deviceusesAF_INETDescribeMountTargetsrejects IPv6-only addresses with a clear errorDefault is
falseso existing behaviour is unchanged.Testing
cargo testsuite passestest_resolve_addr_returns_ipv4,test_resolve_addr_no_ipv4_returns_error,test_plain_text_finder_prefer_ipv4_connectstest_get_fallback_mount_target_ip_address_helper_ipv6_only_prefer_ipv4