ovn-controller: Fix a case wherein tag can be zero.
authorGurucharan Shetty <gshetty@nicira.com>
Mon, 28 Sep 2015 19:41:46 +0000 (12:41 -0700)
committerGurucharan Shetty <gshetty@nicira.com>
Tue, 29 Sep 2015 18:20:51 +0000 (11:20 -0700)
If the ovn-nb DB's logical_port table is populated such
that tag is zero, we should not consider that record.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
ovn/controller/physical.c

index f57acbc..5280916 100644 (file)
@@ -253,9 +253,12 @@ physical_run(struct controller_ctx *ctx, enum mf_field_id mff_ovn_geneve,
             }
             ofport = u16_to_ofp(simap_get(&localnet_to_ofport, network));
         } else if (binding->parent_port) {
+            if (!binding->tag || !*binding->tag) {
+                continue;
+            }
             ofport = u16_to_ofp(simap_get(&localvif_to_ofport,
                                           binding->parent_port));
-            if (ofport && binding->tag) {
+            if (ofport) {
                 tag = *binding->tag;
             }
         } else {