X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fofproto-sflow.c;h=de9bf8987af2e3307f057d38aebd7bedc5e3054f;hb=cb49ee4fd15e1b24aaae4a2d25f3dd538734b4df;hp=3739911d1e1a0f1a2c695e2326393abf1ecd9314;hpb=f1588b1fa1be46231ee079358e428dae74ff09cc;p=openvswitch diff --git a/ofproto/ofproto-sflow.c b/ofproto/ofproto-sflow.c index 3739911d..de9bf898 100644 --- a/ofproto/ofproto-sflow.c +++ b/ofproto/ofproto-sflow.c @@ -27,6 +27,7 @@ #include "netdev.h" #include "ofpbuf.h" #include "ofproto.h" +#include "packets.h" #include "poll-loop.h" #include "sflow_api.h" #include "socket-util.h" @@ -488,8 +489,8 @@ ofproto_sflow_received(struct ofproto_sflow *os, struct odp_msg *msg) const union odp_action *actions; struct ofpbuf payload; size_t n_actions, n_outputs; + struct flow flow; size_t min_size; - flow_t flow; size_t i; /* Get odp_sflow_sample_header. */ @@ -573,12 +574,13 @@ ofproto_sflow_received(struct ofproto_sflow *os, struct odp_msg *msg) n_outputs++; break; - case ODPAT_SET_VLAN_VID: - switchElem.flowType.sw.dst_vlan = ntohs(a->vlan_vid.vlan_vid); - break; - - case ODPAT_SET_VLAN_PCP: - switchElem.flowType.sw.dst_priority = a->vlan_pcp.vlan_pcp; + case ODPAT_SET_DL_TCI: + if (a->dl_tci.mask & htons(VLAN_VID_MASK)) { + switchElem.flowType.sw.dst_vlan = vlan_tci_to_vid(a->dl_tci.tci); + } + if (a->dl_tci.mask & htons(VLAN_PCP_MASK)) { + switchElem.flowType.sw.dst_priority = vlan_tci_to_pcp(a->dl_tci.tci); + } break; default: