From 216114e062b4ee108ff38c6959ff81d166d51368 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 8 Jan 2010 16:10:01 -0800 Subject: [PATCH] sflow: Set proper output port number for dropped packets. Based on advice from Neil McKee. --- ofproto/ofproto-sflow.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ofproto/ofproto-sflow.c b/ofproto/ofproto-sflow.c index 29f7e345..cf63c655 100644 --- a/ofproto/ofproto-sflow.c +++ b/ofproto/ofproto-sflow.c @@ -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; } -- 2.30.2