Valid ethertypes start at 1536.

Signed-off-by: Rich Lane <[email protected]>
---
This is the userspace equivalent of "datapath: Fix parsing invalid LLC/SNAP
ethertypes".

 lib/flow.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/flow.c b/lib/flow.c
index 5e7d1d4..397bda1 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -147,7 +147,12 @@ parse_ethertype(struct ofpbuf *b)
     }
 
     ofpbuf_pull(b, sizeof *llc);
-    return llc->snap.snap_type;
+
+    if (ntohs(llc->snap.snap_type) >= ETH_TYPE_MIN) {
+        return llc->snap.snap_type;
+    }
+
+    return htons(FLOW_DL_TYPE_NONE);
 }
 
 static int
-- 
1.7.9.5

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to