ofproto: Log warning if controller requests an invalid table.
authorBen Pfaff <blp@nicira.com>
Fri, 25 Feb 2011 01:03:28 +0000 (17:03 -0800)
committerBen Pfaff <blp@nicira.com>
Fri, 25 Feb 2011 01:13:30 +0000 (17:13 -0800)
This might have saved us some time debugging.

ofproto/ofproto.c

index 61d08ea..2efb03a 100644 (file)
@@ -3543,7 +3543,16 @@ put_ofp_flow_stats(struct ofconn *ofconn, struct rule *rule,
 static bool
 is_valid_table(uint8_t table_id)
 {
-    return table_id == 0 || table_id == 0xff;
+    if (table_id == 0 || table_id == 0xff) {
+        return true;
+    } else {
+        /* It would probably be better to reply with an error but there doesn't
+         * seem to be any appropriate value, so that might just be
+         * confusing. */
+        VLOG_WARN_RL(&rl, "controller asked for invalid table %"PRIu8,
+                     table_id);
+        return false;
+    }
 }
 
 static int