Skip to content

Commit

Permalink
fix(build): do not use Ethernet_wire
Browse files Browse the repository at this point in the history
This dependency is not available anymore.

I used the same technique used here

mirage/ethernet@61dfc14

to fix the build.
  • Loading branch information
casaroli committed Apr 19, 2024
1 parent dc331cb commit a615cd9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/hostnet/hostnet_dns.ml
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ struct
packet creation fn *)
let frame = Io_page.to_cstruct (Io_page.get 1) in
let smac = "\000\000\000\000\000\000" in
Ethernet__Ethernet_wire.set_ethernet_src smac 0 frame;
Ethernet__Ethernet_wire.set_ethernet_ethertype frame 0x0800;
Cstruct.blit_from_string smac 0 frame 6 6;
Cstruct.BE.set_uint16 frame 12 0x0800;
let buf = Cstruct.shift frame Ethernet.Packet.sizeof_ethernet in
Ipv4_wire.set_ipv4_hlen_version buf ((4 lsl 4) + (5));
Ipv4_wire.set_ipv4_tos buf 0;
Expand All @@ -283,7 +283,7 @@ struct
let tlen = Cstruct.lenv bufs - Ethernet.Packet.sizeof_ethernet in
let dmac = String.make 6 '\000' in
(* Ip.adjust_output_header *)
Ethernet__Ethernet_wire.set_ethernet_dst dmac 0 frame;
Cstruct.blit_from_string dmac 0 frame 0 6;
let buf =
Cstruct.sub frame Ethernet.Packet.sizeof_ethernet Ipv4_wire.sizeof_ipv4
in
Expand Down

0 comments on commit a615cd9

Please sign in to comment.