Skip to content

Commit

Permalink
accept all the ethernet frames of size 14 or more
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesm committed Jul 29, 2015
1 parent 22785f0 commit 26c9311
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/wire_structs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ cenum ethertype {
} as uint16_t

let parse_ethernet_frame frame =
if Cstruct.len frame >= 60 then
(* minimum payload is 46 + source + destination + type *)
if Cstruct.len frame >= 14 then
(* source + destination + type = 14 *)
let payload = Cstruct.shift frame sizeof_ethernet
and typ = get_ethernet_ethertype frame
and dst = Macaddr.of_bytes_exn (copy_ethernet_dst frame)
Expand Down

0 comments on commit 26c9311

Please sign in to comment.