From: Ben Pfaff Date: Sat, 9 Jan 2010 00:10:01 +0000 (-0800) Subject: sflow: Set proper output port number for dropped packets. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=216114e062b4ee108ff38c6959ff81d166d51368;p=openvswitch sflow: Set proper output port number for dropped packets. Based on advice from Neil McKee. --- 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; }