X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fofproto-dpif-sflow.c;h=23f54989aa45b0e76b7058f2543a3753ce15358c;hb=543a550837f40e39c9f6f110e927b4c230c2d77c;hp=78a6dd6ac4836bba7b47f3600531ef8f04786179;hpb=36fc5f183328c538eba3744bec3302972891f3e7;p=openvswitch diff --git a/ofproto/ofproto-dpif-sflow.c b/ofproto/ofproto-dpif-sflow.c index 78a6dd6a..23f54989 100644 --- a/ofproto/ofproto-dpif-sflow.c +++ b/ofproto/ofproto-dpif-sflow.c @@ -18,6 +18,7 @@ #include #include "ofproto-dpif-sflow.h" #include +#include #include #include #include "collectors.h" @@ -491,7 +492,7 @@ dpif_sflow_odp_port_to_ifindex(const struct dpif_sflow *ds, void dpif_sflow_received(struct dpif_sflow *ds, struct ofpbuf *packet, const struct flow *flow, - const struct user_action_cookie *cookie) + const union user_action_cookie *cookie) { SFL_FLOW_SAMPLE_TYPE fs; SFLFlow_sample_element hdrElem; @@ -500,6 +501,7 @@ dpif_sflow_received(struct dpif_sflow *ds, struct ofpbuf *packet, SFLSampler *sampler; struct dpif_sflow_port *in_dsp; struct netdev_stats stats; + ovs_be16 vlan_tci; int error; /* Build a flow sample */ @@ -549,10 +551,11 @@ dpif_sflow_received(struct dpif_sflow *ds, struct ofpbuf *packet, switchElem.flowType.sw.src_priority = vlan_tci_to_pcp(flow->vlan_tci); /* Retrieve data from user_action_cookie. */ - switchElem.flowType.sw.dst_vlan = vlan_tci_to_vid(cookie->vlan_tci); - switchElem.flowType.sw.dst_priority = vlan_tci_to_pcp(cookie->vlan_tci); + vlan_tci = cookie->sflow.vlan_tci; + switchElem.flowType.sw.dst_vlan = vlan_tci_to_vid(vlan_tci); + switchElem.flowType.sw.dst_priority = vlan_tci_to_pcp(vlan_tci); - fs.output = cookie->output; + fs.output = cookie->sflow.output; /* Submit the flow sample to be encoded into the next datagram. */ SFLADD_ELEMENT(&fs, &hdrElem);