From 6888ea2dcf3de0df9a1c54adab4723e43151f720 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Sat, 13 Jul 2019 19:12:21 +0100 Subject: [PATCH 1/2] use ipaddr.4.0.0 interfaces --- .travis.yml | 1 + CHANGES.md | 4 ++++ ethernet.opam | 4 ++-- src/ethernet_packet.ml | 8 ++++---- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index e08b51f..6556217 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,5 +12,6 @@ env: - OCAML_VERSION=4.05 - OCAML_VERSION=4.06 - OCAML_VERSION=4.07 + - OCAML_VERSION=4.08 notifications: email: false diff --git a/CHANGES.md b/CHANGES.md index ae44a50..70e4804 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ +### dev + +* Use ipaddr.4.0.0 interfaces (@avsm) + ### v2.0.0 (2019-02-24) * Adjust to mirage-protocols 2.0.0 and mirage-net 2.0.0 changes diff --git a/ethernet.opam b/ethernet.opam index a0d224a..6bb9230 100644 --- a/ethernet.opam +++ b/ethernet.opam @@ -18,14 +18,14 @@ build: [ ] depends: [ - "dune" {build} + "dune" "ocaml" {>= "4.04.0"} "rresult" {>= "0.5.0"} "cstruct" {>= "3.0.2"} "ppx_cstruct" "mirage-net-lwt" {>= "2.0.0"} "mirage-protocols-lwt" {>= "2.0.0"} - "macaddr" + "macaddr" {>= "4.0.0"} "mirage-profile" {>= "0.5"} "fmt" "lwt" {>= "3.0.0"} diff --git a/src/ethernet_packet.ml b/src/ethernet_packet.ml index ff3570f..62b7416 100644 --- a/src/ethernet_packet.ml +++ b/src/ethernet_packet.ml @@ -25,8 +25,8 @@ module Unmarshal = struct (get_ethernet_ethertype frame)) | Some ethertype -> let payload = Cstruct.shift frame sizeof_ethernet - and source = Macaddr.of_bytes_exn (copy_ethernet_src frame) - and destination = Macaddr.of_bytes_exn (copy_ethernet_dst frame) + and source = Macaddr.of_octets_exn (copy_ethernet_src frame) + and destination = Macaddr.of_octets_exn (copy_ethernet_dst frame) in Ok ({ destination; source; ethertype;}, payload) else @@ -43,8 +43,8 @@ module Marshal = struct let unsafe_fill t buf = let open Ethernet_wire in - set_ethernet_dst (Macaddr.to_bytes t.destination) 0 buf; - set_ethernet_src (Macaddr.to_bytes t.source) 0 buf; + set_ethernet_dst (Macaddr.to_octets t.destination) 0 buf; + set_ethernet_src (Macaddr.to_octets t.source) 0 buf; set_ethernet_ethertype buf (ethertype_to_int t.ethertype); () From 9b831cbfcdabe57899566ccedcf09d1656046ba8 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Mon, 15 Jul 2019 15:17:32 +0100 Subject: [PATCH 2/2] update CHANGES --- CHANGES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 70e4804..37efb42 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,6 @@ -### dev +### v2.1.0 (2019-07-15) -* Use ipaddr.4.0.0 interfaces (@avsm) +* Use ipaddr.4.0.0 interfaces (#5 @avsm) ### v2.0.0 (2019-02-24)