[ovs-dev] [PATCH] ofproto-dpif: Fix CONTROLLER actions for LLC frames.

Ethan Jackson ethan at nicira.com
Thu Mar 22 16:17:42 PDT 2012


The CONTROLLER action assumed that all Ethernet frames stored their
Ethernet Type in the two bytes succeeding the source and
destination addresses.  This turns out not to be true for 802.2 LLC
frames, potentially causing an assertion failure.  This patch
solves the issue by skipping the assertion in this case.

Bug #10349.
Signed-off-by: Ethan Jackson <ethan at nicira.com>
---
 ofproto/ofproto-dpif.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 86b5656..f2b9339 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -4507,7 +4507,13 @@ execute_controller_action(struct action_xlate_ctx *ctx, int len,
 
         eth_pop_vlan(packet);
         eh = packet->l2;
-        assert(eh->eth_type == ctx->flow.dl_type);
+
+        /* If the Ethernet type is less than ETH_TYPE_MIN, it's likely an 802.2
+         * LLC frame.  Calculating the Ethernet type of these frames is more
+         * trouble than seems appropriate for a simple assertion. */
+        assert(ntohs(eh->eth_type) < ETH_TYPE_MIN
+               || eh->eth_type == ctx->flow.dl_type);
+
         memcpy(eh->eth_src, ctx->flow.dl_src, sizeof eh->eth_src);
         memcpy(eh->eth_dst, ctx->flow.dl_dst, sizeof eh->eth_dst);
 
-- 
1.7.9.4




More information about the dev mailing list