diff options
| author | John Schmidt <john.schmidt.h@gmail.com> | 2022-01-11 17:38:49 +0100 |
|---|---|---|
| committer | John Schmidt <john.schmidt.h@gmail.com> | 2022-01-12 19:32:46 +0100 |
| commit | 66fe5bb0d8c5e6279e2b68459b6b37d9244210bc (patch) | |
| tree | 0de1bbb4cef77af19e3fb20abf32f20fffd76ef3 /lib/std/net | |
| parent | c4681b4889652d5228a84ac7af5ad5e17ac39055 (diff) | |
| download | zig-66fe5bb0d8c5e6279e2b68459b6b37d9244210bc.tar.gz zig-66fe5bb0d8c5e6279e2b68459b6b37d9244210bc.zip | |
Use libc if_nametoindex if available when parsing IPs
Fixes https://github.com/ziglang/zig/issues/10521 and makes a couple of
additional tests pass when linking libc.
Diffstat (limited to 'lib/std/net')
| -rw-r--r-- | lib/std/net/test.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/net/test.zig b/lib/std/net/test.zig index f181bb49ea..0fa853151a 100644 --- a/lib/std/net/test.zig +++ b/lib/std/net/test.zig @@ -49,7 +49,7 @@ test "parse and render IPv6 addresses" { try testing.expectError(error.Incomplete, net.Address.parseIp6("FF01:", 0)); try testing.expectError(error.InvalidIpv4Mapping, net.Address.parseIp6("::123.123.123.123", 0)); // TODO Make this test pass on other operating systems. - if (builtin.os.tag == .linux) { + if (builtin.os.tag == .linux or builtin.link_libc) { try testing.expectError(error.Incomplete, net.Address.resolveIp6("ff01::fb%", 0)); try testing.expectError(error.Overflow, net.Address.resolveIp6("ff01::fb%wlp3s0s0s0s0s0s0s0s0", 0)); try testing.expectError(error.Overflow, net.Address.resolveIp6("ff01::fb%12345678901234", 0)); @@ -57,7 +57,7 @@ test "parse and render IPv6 addresses" { } test "invalid but parseable IPv6 scope ids" { - if (builtin.os.tag != .linux) { + if (builtin.os.tag != .linux or !builtin.link_libc) { // Currently, resolveIp6 with alphanumerical scope IDs only works on Linux. // TODO Make this test pass on other operating systems. return error.SkipZigTest; |
