From 40b3b2ff4e155d1245330c6366cedd90930ce599 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 11 Jan 2010 11:10:24 -0800 Subject: [PATCH] sflow: Fix byte order problem. Reported by Justin Pettit. --- ofproto/ofproto-sflow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ofproto/ofproto-sflow.c b/ofproto/ofproto-sflow.c index 208ad8c7..1ad25230 100644 --- a/ofproto/ofproto-sflow.c +++ b/ofproto/ofproto-sflow.c @@ -519,7 +519,7 @@ ofproto_sflow_received(struct ofproto_sflow *os, struct odp_msg *msg) /* Add extended switch element. */ memset(&switchElem, 0, sizeof(switchElem)); switchElem.tag = SFLFLOW_EX_SWITCH; - switchElem.flowType.sw.src_vlan = flow.dl_vlan; + switchElem.flowType.sw.src_vlan = ntohs(flow.dl_vlan); switchElem.flowType.sw.src_priority = -1; /* XXX */ switchElem.flowType.sw.dst_vlan = -1; /* Filled in correctly below. */ switchElem.flowType.sw.dst_priority = switchElem.flowType.sw.src_priority; @@ -542,7 +542,7 @@ ofproto_sflow_received(struct ofproto_sflow *os, struct odp_msg *msg) break; case ODPAT_SET_VLAN_VID: - switchElem.flowType.sw.dst_vlan = a->vlan_vid.vlan_vid; + switchElem.flowType.sw.dst_vlan = ntohs(a->vlan_vid.vlan_vid); break; case ODPAT_SET_VLAN_PCP: -- 2.30.2