Skip to content

Commit

Permalink
Merge pull request #5 from avsm/ipaddr4
Browse files Browse the repository at this point in the history
use ipaddr.4.0.0 interfaces
  • Loading branch information
avsm authored Jul 15, 2019
2 parents 6a3c89e + 9b831cb commit ff45cfc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ env:
- OCAML_VERSION=4.05
- OCAML_VERSION=4.06
- OCAML_VERSION=4.07
- OCAML_VERSION=4.08
notifications:
email: false
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### v2.1.0 (2019-07-15)

* Use ipaddr.4.0.0 interfaces (#5 @avsm)

### v2.0.0 (2019-02-24)

* Adjust to mirage-protocols 2.0.0 and mirage-net 2.0.0 changes
Expand Down
4 changes: 2 additions & 2 deletions ethernet.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
8 changes: 4 additions & 4 deletions src/ethernet_packet.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
()

Expand Down

0 comments on commit ff45cfc

Please sign in to comment.