sflow: Properly fill in initial destination VLAN in sFlow output.
authorNeil McKee <neil.mckee@inmon.com>
Wed, 5 May 2010 20:24:27 +0000 (13:24 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 5 May 2010 20:27:08 +0000 (13:27 -0700)
ofproto/ofproto-sflow.c

index 5488724e0c7c56adca5a846be35fdd72d85ec883..f764dc4ecced1ce32f09097e7d44d87683e71665 100644 (file)
@@ -533,7 +533,9 @@ ofproto_sflow_received(struct ofproto_sflow *os, struct odp_msg *msg)
     switchElem.tag = SFLFLOW_EX_SWITCH;
     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. */
+     /* 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;
     switchElem.flowType.sw.dst_priority = switchElem.flowType.sw.src_priority;
 
     /* Figure out the output ports. */