Switch c INET consts to c from posix

This commit is contained in:
Muaz Ahmad 2024-05-11 16:13:26 +05:00
parent 9b4f850fe5
commit 5b03128c39

View file

@ -28,8 +28,8 @@ fn get_mdns_socket(ip_info: util.IPInfo) !socket {
}; };
const addr = try std.net.Address.resolveIp(target_addr, 5353); const addr = try std.net.Address.resolveIp(target_addr, 5353);
const sock = std.c.socket(switch (ip_info.version) { const sock = std.c.socket(switch (ip_info.version) {
util.IP_VER_ENUM.IPv4 => std.posix.AF.INET, util.IP_VER_ENUM.IPv4 => std.c.AF.INET,
util.IP_VER_ENUM.IPv6 => std.posix.AF.INET6, util.IP_VER_ENUM.IPv6 => std.c.AF.INET6,
}, std.c.SOCK.DGRAM, std.c.IPPROTO.UDP); }, std.c.SOCK.DGRAM, std.c.IPPROTO.UDP);
if (sock == -1) { if (sock == -1) {
return MDNSError.SocketInitFail; return MDNSError.SocketInitFail;