X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fofproto-sflow.c;h=87abef97b59d7d3cf9539e1460d2af81ecbd9727;hb=66642cb40b12594c62f3d3037f1e4efa528416b7;hp=f886b1b09387439a0923ff890ac577dc73b7814c;hpb=85da620e9788b473797b95212b916327974e6942;p=openvswitch diff --git a/ofproto/ofproto-sflow.c b/ofproto/ofproto-sflow.c index f886b1b0..87abef97 100644 --- a/ofproto/ofproto-sflow.c +++ b/ofproto/ofproto-sflow.c @@ -34,7 +34,7 @@ #include "timeval.h" #include "vlog.h" -VLOG_DEFINE_THIS_MODULE(sflow) +VLOG_DEFINE_THIS_MODULE(sflow); struct ofproto_sflow_port { struct hmap_node hmap_node; /* In struct ofproto_sflow's "ports" hmap. */ @@ -554,8 +554,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;