From 7c491f498adf7b62f9484811a23651e7d8c71263 Mon Sep 17 00:00:00 2001 From: Thomas Gazagnaire Date: Mon, 31 Jul 2017 17:28:12 +0200 Subject: [PATCH] Update to lwt 3.0 --- Makefile | 2 +- src/stack-unix/icmpv4_socket.ml | 2 +- src/stack-unix/tcpip_stack_socket.ml | 2 +- src/stack-unix/udpv4_socket.ml | 2 +- src/stack-unix/udpv6_socket.ml | 2 +- tcpip.opam | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 4d454f382..2e2b7dc4a 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ .PHONY: build clean test build: - jbuilder build @install + jbuilder build @install --dev test: jbuilder runtest diff --git a/src/stack-unix/icmpv4_socket.ml b/src/stack-unix/icmpv4_socket.ml index 77ea2a3b8..cdc1bb942 100644 --- a/src/stack-unix/icmpv4_socket.ml +++ b/src/stack-unix/icmpv4_socket.ml @@ -63,7 +63,7 @@ let input t ~src ~dst:_ buf = let listen _t addr fn = let fd = Lwt_unix.(socket PF_INET SOCK_DGRAM) ipproto_icmp in let sa = Lwt_unix.ADDR_INET (Unix.inet_addr_of_string (Ipaddr.V4.to_string addr), port) in - Lwt_unix.Versioned.bind_2 fd sa >>= fun () -> + Lwt_unix.bind fd sa >>= fun () -> Log.debug (fun f -> f "Bound ICMP file descriptor to %a" pp_sockaddr sa); let aux fn = let receive_buffer = Cstruct.create 4096 in diff --git a/src/stack-unix/tcpip_stack_socket.ml b/src/stack-unix/tcpip_stack_socket.ml index cf7503d67..c2c66ded0 100644 --- a/src/stack-unix/tcpip_stack_socket.ml +++ b/src/stack-unix/tcpip_stack_socket.ml @@ -110,7 +110,7 @@ let listen_tcpv4 _t ~port callback = let interface = Ipaddr_unix.V4.to_inet_addr Ipaddr.V4.any in (* FIXME: we should not ignore the result *) ignore_result ( - Lwt_unix.Versioned.bind_2 fd (Lwt_unix.ADDR_INET (interface, port)) + Lwt_unix.bind fd (Lwt_unix.ADDR_INET (interface, port)) >>= fun () -> Lwt_unix.listen fd 10; let rec loop () = diff --git a/src/stack-unix/udpv4_socket.ml b/src/stack-unix/udpv4_socket.ml index 5e8262ace..78c270695 100644 --- a/src/stack-unix/udpv4_socket.ml +++ b/src/stack-unix/udpv4_socket.ml @@ -35,7 +35,7 @@ let get_udpv4_listening_fd {listen_fds;interface} port = Lwt.return @@ Hashtbl.find listen_fds (interface,port) with Not_found -> let fd = Lwt_unix.(socket PF_INET SOCK_DGRAM 0) in - Lwt_unix.Versioned.bind_2 fd (Lwt_unix.ADDR_INET (interface, port)) + Lwt_unix.bind fd (Lwt_unix.ADDR_INET (interface, port)) >>= fun () -> Hashtbl.add listen_fds (interface, port) fd; Lwt.return fd diff --git a/src/stack-unix/udpv6_socket.ml b/src/stack-unix/udpv6_socket.ml index 2be6e750e..23d0a8f14 100644 --- a/src/stack-unix/udpv6_socket.ml +++ b/src/stack-unix/udpv6_socket.ml @@ -35,7 +35,7 @@ let get_udpv6_listening_fd {listen_fds;interface} port = Lwt.return @@ Hashtbl.find listen_fds (interface,port) with Not_found -> let fd = Lwt_unix.(socket PF_INET6 SOCK_DGRAM 0) in - Lwt_unix.Versioned.bind_2 fd (Lwt_unix.ADDR_INET (interface,port)) + Lwt_unix.bind fd (Lwt_unix.ADDR_INET (interface,port)) >>= fun () -> Hashtbl.add listen_fds (interface,port) fd; Lwt.return fd diff --git a/tcpip.opam b/tcpip.opam index b828fe435..f0dc1c928 100644 --- a/tcpip.opam +++ b/tcpip.opam @@ -43,7 +43,7 @@ depends: [ "pcap-format" {test} "mirage-clock-unix" {test & >= "1.2.0"} "fmt" - "lwt" {>= "2.7.0"} + "lwt" {>= "3.0.0"} "logs" {>= "0.6.0"} "duration" "io-page-unix"