From 2ec2380a54d993f90afd137bd6ed8b340b7db86a Mon Sep 17 00:00:00 2001 From: anlicheng <244108715@qq.com> Date: Mon, 13 Apr 2026 14:51:17 +0800 Subject: [PATCH] fix --- src/dns_proxy/dns_server_sup.erl | 2 +- src/sdlan_hostname_regedit.erl | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/dns_proxy/dns_server_sup.erl b/src/dns_proxy/dns_server_sup.erl index 1f3f898..9d26ef8 100644 --- a/src/dns_proxy/dns_server_sup.erl +++ b/src/dns_proxy/dns_server_sup.erl @@ -33,7 +33,7 @@ init([]) -> Name = dns_server:get_name(Id), #{ id => Name, - start => {sdlan_stun, start_link, [Name, Port]}, + start => {dns_server, start_link, [Name, Port]}, restart => permanent, shutdown => 2000, type => worker, diff --git a/src/sdlan_hostname_regedit.erl b/src/sdlan_hostname_regedit.erl index ef81b67..0acb7a4 100644 --- a/src/sdlan_hostname_regedit.erl +++ b/src/sdlan_hostname_regedit.erl @@ -19,7 +19,8 @@ init() -> -spec lookup(FullHostname :: binary()) -> error | {ok, Ip :: inet:ip4_address()}. lookup(FullHostname) when is_binary(FullHostname) -> - case ets:lookup(?TABLE, FullHostname) of + LowerFullHostname = string:lowercase(FullHostname), + case ets:lookup(?TABLE, LowerFullHostname) of [{_, Ip}] -> {ok, Ip}; [] -> @@ -29,7 +30,8 @@ lookup(FullHostname) when is_binary(FullHostname) -> -spec insert(any(), Domain :: binary(), Ip :: integer()) -> no_return(). insert(HostName, Domain, Ip) when is_binary(HostName), is_binary(Domain), is_integer(Ip), HostName /= <<>> -> FullHostname = <>, + LowerFullHostname = string:lowercase(FullHostname), <> = <>, - true = ets:insert(?TABLE, {FullHostname, {Ip0, Ip1, Ip2, Ip3}}); + true = ets:insert(?TABLE, {LowerFullHostname, {Ip0, Ip1, Ip2, Ip3}}); insert(_, _, _) -> ok. \ No newline at end of file