aboutsummaryrefslogtreecommitdiff
path: root/core/net/dns_unix.odin
diff options
context:
space:
mode:
authorLaytan Laats <laytanlaats@hotmail.com>2026-01-11 20:07:03 +0100
committerLaytan Laats <laytanlaats@hotmail.com>2026-01-11 20:21:21 +0100
commitc10771305d91b966f7520b830c398abffe4e9e1d (patch)
tree185497758d0298c4e23f15992a0bb48a44936863 /core/net/dns_unix.odin
parenta6ec199a52ae83603921fcf948fdf45e327fd17d (diff)
net: implement OpenBSD and NetBSD support & add stubs for other targets & cleanup
Diffstat (limited to 'core/net/dns_unix.odin')
-rw-r--r--core/net/dns_unix.odin13
1 files changed, 9 insertions, 4 deletions
diff --git a/core/net/dns_unix.odin b/core/net/dns_unix.odin
index fbc1909cd..be95b8341 100644
--- a/core/net/dns_unix.odin
+++ b/core/net/dns_unix.odin
@@ -1,4 +1,4 @@
-#+build linux, darwin, freebsd
+#+build linux, darwin, freebsd, openbsd, netbsd
package net
/*
Package net implements cross-platform Berkeley Sockets, DNS resolution and associated procedures.
@@ -42,14 +42,19 @@ _get_dns_records_os :: proc(hostname: string, type: DNS_Record_Type, allocator :
}
hosts, hosts_ok := load_hosts(dns_configuration.hosts_file)
- defer delete(hosts)
if !hosts_ok {
return nil, .Invalid_Hosts_Config_Error
}
+ defer {
+ for h in hosts {
+ delete(h.name)
+ }
+ delete(hosts)
+ }
host_overrides := make([dynamic]DNS_Record)
for host in hosts {
- if strings.compare(host.name, hostname) != 0 {
+ if host.name != hostname {
continue
}
@@ -79,4 +84,4 @@ _get_dns_records_os :: proc(hostname: string, type: DNS_Record_Type, allocator :
}
return get_dns_records_from_nameservers(hostname, type, name_servers, host_overrides[:])
-} \ No newline at end of file
+}