Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
0377-Fix-a-missing-ok-Name-wrapper.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0377-Fix-a-missing-ok-Name-wrapper.patch of Package erlang
From 549c60ac3070bf126c850efde894269733255ca6 Mon Sep 17 00:00:00 2001 From: Raimo Niskanen <raimo@erlang.org> Date: Tue, 24 May 2022 16:26:01 +0200 Subject: [PATCH] Fix a missing {ok,Name} wrapper --- lib/kernel/src/inet_res.erl | 8 ++++---- lib/kernel/test/inet_res_SUITE.erl | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/kernel/src/inet_res.erl b/lib/kernel/src/inet_res.erl index 6570f752cb..4e7809564c 100644 --- a/lib/kernel/src/inet_res.erl +++ b/lib/kernel/src/inet_res.erl @@ -147,7 +147,7 @@ resolve(Name, Class, Type, Opts, Timeout) -> Res = res_query(Nm, Class, Type, Opts, Timer), _ = inet:stop_timer(Timer), Res; - Error -> + {error, _} = Error -> Error end. @@ -371,7 +371,7 @@ gethostbyaddr_tm(IP, Timer) -> case dn_ip(norm_ip(IP)) of {error, _} = Error -> Error; - Name -> + {ok, Name} -> %% Try cached first inet_db:res_update_conf(), case inet_db:gethostbyaddr(Name, IP) of @@ -1182,7 +1182,7 @@ dn_ip(_) -> {error, formerr}. dn_ipv4([], Dn) -> - Dn; + {ok, Dn}; dn_ipv4([A | As], Dn_0) when is_integer(A), A =< 255 -> Dn = [$. | Dn_0], if @@ -1198,7 +1198,7 @@ dn_ipv4([A | As], Dn_0) when is_integer(A), A =< 255 -> end. dn_ipv6([], Dn) -> - Dn; + {ok, Dn}; dn_ipv6([W | Ws], Dn) when is_integer(W), W =< 16#ffff -> D = W band 16#f, W_1 = W bsr 4, C = W_1 band 16#f, W_2 = W_1 bsr 4, diff --git a/lib/kernel/test/inet_res_SUITE.erl b/lib/kernel/test/inet_res_SUITE.erl index 60589c33dc..929b1d0737 100644 --- a/lib/kernel/test/inet_res_SUITE.erl +++ b/lib/kernel/test/inet_res_SUITE.erl @@ -566,6 +566,16 @@ basic(Config) when is_list(Config) -> true = (tolower(inet_dns:rr(RR2c, domain)) =:= tolower(inet_dns:rr(RR2d, domain))), + ?P("resolve \"127.0.0.1\"~n", []), + {ok, Msg3} = + inet_res:resolve("127.0.0.1", in, a, [{nameservers,[NS]},verbose]), + [] = inet_dns:msg(Msg3, anlist), + {ok, Msg4} = + inet_res:resolve("127.0.0.1", in, ptr, [{nameservers,[NS]},verbose]), + [RR4] = inet_dns:msg(Msg4, anlist), + "1.0.0.127.in-addr.arpa" = inet_dns:rr(RR4, domain), + "test1-78901234567890123456789012345678.otptest" = + inet_dns:rr(RR4, data), %% %% lookup ?P("lookup"), -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor