The physical module currently has an inverse version of
`lport_can_bind_on_this_chassis` duplicated in its code.

Make use of the common helper instead.

Signed-off-by: Frode Nordahl <[email protected]>
---
 controller/physical.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/controller/physical.c b/controller/physical.c
index ac16a6a3b..aa1d44bc6 100644
--- a/controller/physical.c
+++ b/controller/physical.c
@@ -1069,11 +1069,7 @@ consider_port_binding(struct ovsdb_idl_index 
*sbrec_port_binding_by_name,
     } else {
         ofport = local_binding_get_lport_ofport(local_bindings,
                                                 binding->logical_port);
-        const char *requested_chassis = smap_get(&binding->options,
-                                                 "requested-chassis");
-        if (ofport && requested_chassis && requested_chassis[0] &&
-            strcmp(requested_chassis, chassis->name) &&
-            strcmp(requested_chassis, chassis->hostname)) {
+        if (ofport && !lport_can_bind_on_this_chassis(chassis, binding)) {
             /* Even though there is an ofport for this port_binding, it is
              * requested on a different chassis. So ignore this ofport.
              */
-- 
2.32.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to