Use proper byte order for dl_type of 802.2, non-SNAP frames.
authorBen Pfaff <blp@nicira.com>
Thu, 14 Aug 2008 18:05:50 +0000 (11:05 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 14 Aug 2008 18:06:18 +0000 (11:06 -0700)
datapath/flow.c
lib/flow.c

index 36316a9..afd91bf 100644 (file)
@@ -256,7 +256,7 @@ int flow_extract(struct sk_buff *skb, uint16_t in_port,
                if (snap_get_ethertype(skb, &key->dl_type) != -EINVAL) {
                        nh_ofs += sizeof(struct snap_hdr);
                } else {
-                       key->dl_type = OFP_DL_TYPE_NOT_ETH_TYPE;
+                       key->dl_type = htons(OFP_DL_TYPE_NOT_ETH_TYPE);
                        nh_ofs += sizeof(struct llc_pdu_un);
                }
        }
index f534f57..5eea06b 100644 (file)
@@ -133,7 +133,7 @@ flow_extract(struct buffer *packet, uint16_t in_port, struct flow *flow)
                 flow->dl_type = h->snap.snap_type;
                 buffer_pull(&b, sizeof *h);
             } else {
-                flow->dl_type = OFP_DL_TYPE_NOT_ETH_TYPE;
+                flow->dl_type = htons(OFP_DL_TYPE_NOT_ETH_TYPE);
                 buffer_pull(&b, sizeof(struct llc_header));
             }
         }