summaryrefslogtreecommitdiff
path: root/lib/flow.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/flow.c')
-rw-r--r--lib/flow.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/flow.c b/lib/flow.c
index aa1cc47ea..e54280a45 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -859,10 +859,14 @@ flow_format(struct ds *ds, const struct flow *flow)
/* As this function is most often used for formatting a packet in a
* packet-in message, skip formatting the packet context fields that are
- * all-zeroes (Openflow spec encourages leaving out all-zeroes context
- * fields from the packet-in messages). We make an exception with the
- * 'in_port' field, which we always format, as packets usually have an
- * in_port, and 0 is a port just like any other port. */
+ * all-zeroes to make the print-out easier on the eyes. This means that a
+ * missing context field implies a zero value for that field. This is
+ * similar to OpenFlow encoding of these fields, as the specification
+ * states that all-zeroes context fields should not be encoded in the
+ * packet-in messages. */
+ if (!flow->in_port.ofp_port) {
+ WC_UNMASK_FIELD(wc, in_port);
+ }
if (!flow->skb_priority) {
WC_UNMASK_FIELD(wc, skb_priority);
}