When using .dns() targets with IPv6 link-local addresses (e.g., fe80::1%eth0), the connection fails with EINVAL (errno 22) because the scope ID is silently dropped during address conversion.
IPv6 link-local addresses require a scope ID to identify which network interface to route through. Without it, the kernel rejects the connect() call.
How to reproduce
let transport = try HTTP2ClientTransport.Posix(
target: .dns(host: "fe80::1%eth0", port: 50051),
transportSecurity: .plaintext
)
// Fails with: connect(descriptor:addr:size:): Invalid argument (errno: 22)
Environment
- grpc-swift-nio-transport 2.x
- Linux (Glibc), tested on x86_64 and aarch64 (Jetson)
- USB CDC NCM gadget networking with IPv6 link-local only connectivity
When using .dns() targets with IPv6 link-local addresses (e.g., fe80::1%eth0), the connection fails with EINVAL (errno 22) because the scope ID is silently dropped during address conversion.
IPv6 link-local addresses require a scope ID to identify which network interface to route through. Without it, the kernel rejects the connect() call.
How to reproduce
Environment