catch arp packet failure: potential packets created before an uplink change and pending to be sent

This commit is contained in:
palainp 2023-07-12 16:51:03 +02:00
parent 2d822302d8
commit 82d5a239fc

View File

@ -290,9 +290,17 @@ struct
match Client_eth.ARP.input fixed_arp arp with
| None -> Lwt.return_unit
| Some response ->
iface#writev `ARP (fun b ->
Arp_packet.encode_into response b;
Arp_packet.size))
Lwt.catch
(fun () ->
iface#writev `ARP (fun b ->
Arp_packet.encode_into response b;
Arp_packet.size))
(fun ex ->
Log.warn (fun f ->
f "Failed to write APR to %a: %s" Ipaddr.V4.pp iface#other_ip
(Printexc.to_string ex));
Lwt.return_unit)
)
(** Handle an IPv4 packet from the client. *)
let client_handle_ipv4 get_ts cache ~iface ~router dns_client dns_servers