From 26c93110e3779af3f1d77f3639849005043ac1b9 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Wed, 29 Jul 2015 10:30:25 +0100 Subject: [PATCH] accept all the ethernet frames of size 14 or more --- lib/wire_structs.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/wire_structs.ml b/lib/wire_structs.ml index 15b6bd59a..0223e8911 100644 --- a/lib/wire_structs.ml +++ b/lib/wire_structs.ml @@ -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)