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

option parsing: continue building ip tuple list for lengths > 1 #55

Closed
wants to merge 2 commits 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE.md
@@ -1,4 +1,4 @@
Copyright (c) 2015 Christiano F. Haesbaert <haesbaert@haesbaert.org>
Copyright (c) 2015 Christiano F. Haesbaert, Mindy Preston

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
6 changes: 3 additions & 3 deletions lib/dhcp_wire.ml
Expand Up @@ -588,9 +588,9 @@ let options_of_buf buf buf_len =
let get_ip_list ?(min_len=4) () =
List.map Ipaddr.V4.of_int32 (get_32_list ~min_len:min_len ())
in
let get_ip_tuple_list () =
let loop ips tuples = match ips with
| ip1 :: ip2 :: tl -> (ip1, ip2) :: tuples
let get_ip_tuple_list l =
let rec loop ips tuples = match ips with
| ip1 :: ip2 :: tl -> loop tl ((ip1, ip2) :: tuples)
| ip :: [] -> invalid_arg bad_len
| [] -> List.rev tuples
in
Expand Down