Both lookups were missing some fields, for the route lookup
the nexthop check was actually reversed. Fix all of those issues.

Fixes: 33ecea5b9b13 ("Logical Router Policy chains.")
Fixes: 84030e9bb70b ("Support selection fields for ECMP routes.")
Fixes: cd4ad2f56179 ("northd: Redistribution of NAT/LB routes.")
Fixes: 77af2fd305f0 ("northd: Add the capability to select static routes to 
advertise via BGP.")
Fixes: f8924740f26e ("northd: Move connected routes to route engine.")
Fixes: 15c9c9f42ad8 ("northd: Add bfd, static_routes, route_policies and 
bfd_sync nodes to I-P engine.")
Signed-off-by: Ales Musil <[email protected]>
---
 northd/northd.c | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/northd/northd.c b/northd/northd.c
index aa332c449..78972160f 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -12238,11 +12238,11 @@ parsed_route_lookup(struct hmap *routes, size_t hash,
             continue;
         }
 
-        if (pr->nexthop && ipv6_addr_equals(pr->nexthop, new_pr->nexthop)) {
+        if (pr->nexthop && !ipv6_addr_equals(pr->nexthop, new_pr->nexthop)) {
             continue;
         }
 
-        if (memcmp(&pr->prefix, &new_pr->prefix, sizeof(struct in6_addr))) {
+        if (!ipv6_addr_equals(&pr->prefix, &new_pr->prefix)) {
             continue;
         }
 
@@ -12283,6 +12283,20 @@ parsed_route_lookup(struct hmap *routes, size_t hash,
             continue;
         }
 
+        if (!sset_equals(&pr->ecmp_selection_fields,
+                         &new_pr->ecmp_selection_fields)) {
+            continue;
+        }
+
+        if (pr->tracked_port != new_pr->tracked_port) {
+            continue;
+        }
+
+        if (pr->dynamic_routing_advertise !=
+            new_pr->dynamic_routing_advertise) {
+            continue;
+        }
+
         return pr;
     }
 
@@ -15377,6 +15391,14 @@ route_policies_lookup(struct hmap *route_policies, 
size_t hash,
             continue;
         }
 
+        if (rp->chain_id != new_rp->chain_id) {
+            continue;
+        }
+
+        if (rp->jump_chain_id != new_rp->jump_chain_id) {
+            continue;
+        }
+
         if (rp->n_valid_nexthops != new_rp->n_valid_nexthops) {
             continue;
         }
-- 
2.54.0

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

Reply via email to