Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't return an empty label from to_domain_name #54

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/ipaddr.ml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ module V4 = struct
Int32.to_string (i >! 24);
"in-addr";
"arpa";
"";
]

(* constant *)
Expand Down Expand Up @@ -674,7 +673,6 @@ module V6 = struct
hex_string_of_int32 ((a >|> 28) &&& 0xF_l);
"ip6";
"arpa";
"";
])

(* constant *)
Expand Down
4 changes: 2 additions & 2 deletions lib_test/test_ipaddr.ml
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ module Test_v4 = struct

let test_domain_name () =
let ip = V4.of_string_exn "128.64.32.16" in
let name = "16.32.64.128.in-addr.arpa." in
let name = "16.32.64.128.in-addr.arpa" in
assert_equal ~msg:"domain_name"
(String.concat "." (V4.to_domain_name ip)) name

Expand Down Expand Up @@ -601,7 +601,7 @@ module Test_v6 = struct
let test_domain_name () =
let ip = V6.of_string_exn "2a00:1450:4009:800::200e" in
let name =
"e.0.0.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.0.9.0.0.4.0.5.4.1.0.0.a.2.ip6.arpa."
"e.0.0.2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.0.9.0.0.4.0.5.4.1.0.0.a.2.ip6.arpa"
in
assert_equal ~msg:"domain_name"
(String.concat "." (V6.to_domain_name ip)) name
Expand Down