try to make the packet type difference a bit clearer

This commit is contained in:
Mindy 2019-05-16 17:44:58 -04:00
parent ad48a0f78a
commit 0d54f80b6b

View File

@ -89,9 +89,9 @@ let nat_to t ~host ~port packet =
(* Handle incoming packets *) (* Handle incoming packets *)
let apply_rules t (rules : ('a, 'b) Packet.t -> Packet.action) ~dst (firewall_packet : ('a, 'b) Packet.t) : unit Lwt.t = let apply_rules t (rules : ('a, 'b) Packet.t -> Packet.action) ~dst (annotated_packet : ('a, 'b) Packet.t) : unit Lwt.t =
let packet = to_mirage_nat_packet firewall_packet in let packet = to_mirage_nat_packet annotated_packet in
match rules firewall_packet, dst with match rules annotated_packet, dst with
| `Accept, `Client client_link -> transmit_ipv4 packet client_link | `Accept, `Client client_link -> transmit_ipv4 packet client_link
| `Accept, (`External _ | `NetVM) -> transmit_ipv4 packet t.Router.uplink | `Accept, (`External _ | `NetVM) -> transmit_ipv4 packet t.Router.uplink
| `Accept, (`Firewall_uplink | `Client_gateway) -> | `Accept, (`Firewall_uplink | `Client_gateway) ->