From 554e73a46d252a7613d986f59718e9127c1aed9a Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Sat, 8 Feb 2020 15:55:32 +0100 Subject: [PATCH] cleanup: remove exception cases during Ethernet decode / Nat.of_ipv4_packet - they do not raise exceptions anymore --- client_net.ml | 5 ----- uplink.ml | 5 ----- 2 files changed, 10 deletions(-) diff --git a/client_net.ml b/client_net.ml index 4665aa1..86f9d3a 100644 --- a/client_net.ml +++ b/client_net.ml @@ -87,11 +87,6 @@ let add_vif get_ts { Dao.ClientVif.domid; device_id } ~client_ip ~router ~cleanu let fragment_cache = Fragments.Cache.create (256 * 1024) in Netback.listen backend ~header_size:Ethernet_wire.sizeof_ethernet (fun frame -> match Ethernet_packet.Unmarshal.of_cstruct frame with - | exception ex -> - Log.err (fun f -> f "Error unmarshalling ethernet frame from client: %s@.%a" (Printexc.to_string ex) - Cstruct.hexdump_pp frame - ); - Lwt.return_unit | Error err -> Log.warn (fun f -> f "Invalid Ethernet frame: %s" err); Lwt.return_unit | Ok (eth, payload) -> match eth.Ethernet_packet.ethertype with diff --git a/uplink.ml b/uplink.ml index 039e6bd..4683d09 100644 --- a/uplink.ml +++ b/uplink.ml @@ -38,11 +38,6 @@ let listen t get_ts router = ~arpv4:(Arp.input t.arp) ~ipv4:(fun ip -> match Nat_packet.of_ipv4_packet t.fragments ~now:(get_ts ()) ip with - | exception ex -> - Log.err (fun f -> f "Error unmarshalling ethernet frame from uplink: %s@.%a" (Printexc.to_string ex) - Cstruct.hexdump_pp frame - ); - Lwt.return_unit | Error e -> Log.warn (fun f -> f "Ignored unknown IPv4 message from uplink: %a" Nat_packet.pp_error e); Lwt.return_unit