X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fofproto-sflow.c;h=801614d231852380aaf54351137d65d118f739c0;hb=8961de6adfd44216f47007ff75fd1cea213d7e31;hp=04e8347050628eb68d565c3560b79165ccc99b5c;hpb=d98e60075528c3065ad453f7add4b30f22edcde3;p=openvswitch diff --git a/ofproto/ofproto-sflow.c b/ofproto/ofproto-sflow.c index 04e83470..801614d2 100644 --- a/ofproto/ofproto-sflow.c +++ b/ofproto/ofproto-sflow.c @@ -517,8 +517,7 @@ ofproto_sflow_received(struct ofproto_sflow *os, struct odp_msg *msg) actions = (const union odp_action *) (hdr + 1); /* Get packet payload and extract flow. */ - payload.data = (union odp_action *) (actions + n_actions); - payload.size = msg->length - min_size; + ofpbuf_use_const(&payload, actions + n_actions, msg->length - min_size); flow_extract(&payload, 0, msg->port, &flow); /* Build a flow sample */ @@ -554,8 +553,8 @@ 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 = ntohs(flow.dl_vlan); - switchElem.flowType.sw.src_priority = -1; /* XXX */ + switchElem.flowType.sw.src_vlan = vlan_tci_to_vid(flow.vlan_tci); + switchElem.flowType.sw.src_priority = vlan_tci_to_pcp(flow.vlan_tci); /* Initialize the output VLAN and priority to be the same as the input, but these fields can be overriden below if affected by an action. */ switchElem.flowType.sw.dst_vlan = switchElem.flowType.sw.src_vlan;