ovn-controller: Update check for parent port.
authorRussell Bryant <russell@ovn.org>
Wed, 20 Jan 2016 16:17:58 +0000 (11:17 -0500)
committerRussell Bryant <russell@ovn.org>
Thu, 21 Jan 2016 16:50:53 +0000 (11:50 -0500)
There were a couple of checks that checked for a parent port as the
field being non-NULL.  We should treat an empty string the same as NULL
for this field.

Signed-off-by: Russell Bryant <russell@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
ovn/controller/physical.c

index 5821c11..b02df74 100644 (file)
@@ -279,7 +279,7 @@ physical_run(struct controller_ctx *ctx, enum mf_field_id mff_ovn_geneve,
             if (ofport && binding->tag) {
                 tag = *binding->tag;
             }
-        } else if (binding->parent_port) {
+        } else if (binding->parent_port && *binding->parent_port) {
             if (!binding->tag) {
                 continue;
             }
@@ -542,7 +542,7 @@ physical_run(struct controller_ctx *ctx, enum mf_field_id mff_ovn_geneve,
                          &remote_ofpacts);
                 put_resubmit(OFTABLE_DROP_LOOPBACK, &remote_ofpacts);
             } else if (simap_contains(&localvif_to_ofport,
-                               port->parent_port
+                               (port->parent_port && *port->parent_port)
                                ? port->parent_port : port->logical_port)) {
                 put_load(port->tunnel_key, MFF_LOG_OUTPORT, 0, 32, &ofpacts);
                 put_resubmit(OFTABLE_DROP_LOOPBACK, &ofpacts);