sflow: Set proper output port number for dropped packets.
authorBen Pfaff <blp@nicira.com>
Sat, 9 Jan 2010 00:10:01 +0000 (16:10 -0800)
committerBen Pfaff <blp@nicira.com>
Sat, 9 Jan 2010 00:10:01 +0000 (16:10 -0800)
Based on advice from Neil McKee.

ofproto/ofproto-sflow.c

index 29f7e34587cf903405ac23cb89b3b983ec5a1b41..cf63c65501d5cb1168cff978133efd636f7de13c 100644 (file)
@@ -535,7 +535,11 @@ ofproto_sflow_received(struct ofproto_sflow *os, struct odp_msg *msg)
             break;
         }
     }
-    if (n_outputs > 1 || !fs.output) {
+    if (!n_outputs) {
+        /* This value indicates that the packet was dropped for an unknown
+         * reason. */
+        fs.output = 0x40000000 | 256;
+    } else if (n_outputs > 1 || !fs.output) {
         /* Setting the high bit means "multiple output ports". */
         fs.output = 0x80000000 | n_outputs;
     }