mirror of
https://github.com/mirage/qubes-mirage-firewall.git
synced 2025-03-03 04:19:21 -05:00
avoid fmt and cstruct deprecation warnings
This commit is contained in:
parent
7e3303a8d6
commit
d4e365a499
@ -27,7 +27,7 @@ let writev eth dst proto fillfn =
|
||||
)
|
||||
|
||||
class client_iface eth ~domid ~gateway_ip ~client_ip client_mac : client_link =
|
||||
let log_header = Fmt.strf "dom%d:%a" domid Ipaddr.V4.pp client_ip in
|
||||
let log_header = Fmt.str "dom%d:%a" domid Ipaddr.V4.pp client_ip in
|
||||
object
|
||||
val queue = FrameQ.create (Ipaddr.V4.to_string client_ip)
|
||||
val mutable rules = []
|
||||
@ -99,7 +99,7 @@ let add_vif get_ts { Dao.ClientVif.domid; device_id } dns_client ~client_ip ~rou
|
||||
else begin
|
||||
Log.debug (fun m -> m "New firewall rules for %s@.%a"
|
||||
(Ipaddr.V4.to_string client_ip)
|
||||
Fmt.(list ~sep:(unit "@.") Pf_qubes.Parse_qubes.pp_rule) new_rules);
|
||||
Fmt.(list ~sep:(any "@.") Pf_qubes.Parse_qubes.pp_rule) new_rules);
|
||||
(* empty NAT table if rules are updated: they might deny old connections *)
|
||||
My_nat.remove_connections router.Router.nat router.Router.ports client_ip;
|
||||
end);
|
||||
|
@ -22,7 +22,7 @@ let transmit_ipv4 packet iface =
|
||||
0
|
||||
| Ok (n, frags) -> fragments := frags ; n) >>= fun () ->
|
||||
Lwt_list.iter_s (fun f ->
|
||||
let size = Cstruct.len f in
|
||||
let size = Cstruct.length f in
|
||||
iface#writev `IPv4 (fun b -> Cstruct.blit f 0 b 0 size ; size))
|
||||
!fragments)
|
||||
(fun ex ->
|
||||
|
@ -45,4 +45,4 @@ let error fmt =
|
||||
|
||||
let or_raise msg pp = function
|
||||
| Ok x -> x
|
||||
| Error e -> failwith (Fmt.strf "%s: %a" msg pp e)
|
||||
| Error e -> failwith (Fmt.str "%s: %a" msg pp e)
|
||||
|
Loading…
x
Reference in New Issue
Block a user