From b3ecefe72a52474b898deb84f8e57cfe06e27a77 Mon Sep 17 00:00:00 2001 From: Thomas Gazagnaire Date: Thu, 30 Mar 2017 19:57:36 +0200 Subject: [PATCH] miragesdk: do not die brutally when the calf terminates Signed-off-by: Thomas Gazagnaire --- projects/miragesdk/examples/mirage-dhcp.yml | 2 +- projects/miragesdk/src/sdk/init.ml | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/projects/miragesdk/examples/mirage-dhcp.yml b/projects/miragesdk/examples/mirage-dhcp.yml index 61a23587c..f3c7cef50 100644 --- a/projects/miragesdk/examples/mirage-dhcp.yml +++ b/projects/miragesdk/examples/mirage-dhcp.yml @@ -19,7 +19,7 @@ system: command: [/usr/bin/binfmt, -dir, /etc/binfmt.d/, -mount, /binfmt_misc] - name: dhcp-client network_mode: host - image: "mobylinux/dhcp-client:da4e4b37ecd11ce411b0b45bde988281c2b35e3a" + image: "mobylinux/dhcp-client:aaf811d77ff8d8b2e16ca4dd9d0a2849ef8977b6" capabilities: - CAP_NET_ADMIN # to bring eth0 up - CAP_NET_RAW # to read /dev/eth0 diff --git a/projects/miragesdk/src/sdk/init.ml b/projects/miragesdk/src/sdk/init.ml index c44e7ae84..b77e48f88 100644 --- a/projects/miragesdk/src/sdk/init.ml +++ b/projects/miragesdk/src/sdk/init.ml @@ -78,9 +78,7 @@ module Fd = struct let buf = Bytes.create len in let rec loop () = Lwt_unix.read src.fd buf 0 len >>= fun len -> - if len = 0 then - (* FIXME: why this ever happen *) - Fmt.kstrf Lwt.fail_with "FORWARD[%a => %a]: EOF" pp src pp dst + if len = 0 then Lwt.return_unit (* EOF *) else ( Log.debug (fun l -> l "FORWARD[%a => %a]: %S (%d)"