From: Ben Pfaff Date: Thu, 14 Aug 2008 18:05:50 +0000 (-0700) Subject: Use proper byte order for dl_type of 802.2, non-SNAP frames. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b0470d419b389507e2d1a47e4a7beac8043f7a6;p=openvswitch Use proper byte order for dl_type of 802.2, non-SNAP frames. --- diff --git a/datapath/flow.c b/datapath/flow.c index 36316a93..afd91bf9 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -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); } } diff --git a/lib/flow.c b/lib/flow.c index f534f579..5eea06b2 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -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)); } }