From c50ac9a764c9022e69c9885b17083d70223cb1aa Mon Sep 17 00:00:00 2001 From: Luna Date: Mon, 30 Mar 2020 16:05:22 -0300 Subject: [PATCH] Change Unsupported to InterfaceNotFound --- lib/std/net.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/std/net.zig b/lib/std/net.zig index b4e2254da..1596df2d7 100644 --- a/lib/std/net.zig +++ b/lib/std/net.zig @@ -542,14 +542,17 @@ fn if_nametoindex(name: []const u8) !u32 { switch (os.errno(rc)) { os.EBADF => return error.BadFile, os.EINTR => return error.CaughtSignal, - os.EINVAL => unreachable, os.EIO => return error.FileSystem, + os.EINVAL => unreachable, os.ENOTTY => unreachable, os.ENXIO => unreachable, - os.ENODEV => return error.Unsupported, + // ioctl() sends ENODEV for an unknown scope id. + os.ENODEV => return error.InterfaceNotFound, else => {}, } + std.debug.warn("ival={}\n", .{ifr.ifr_ifru.ifru_ivalue}); + return @bitCast(u32, ifr.ifr_ifru.ifru_ivalue); }