Skip to content

Commit 558ee0a

Browse files
committed
northd: Fix the route and route policy lookup functions.
Both lookups were missing some fields, for the route lookup the nexthop check was actually reversed. Fix all of those issues. Fixes: 33ecea5 ("Logical Router Policy chains.") Fixes: 84030e9 ("Support selection fields for ECMP routes.") Fixes: cd4ad2f ("northd: Redistribution of NAT/LB routes.") Fixes: 77af2fd ("northd: Add the capability to select static routes to advertise via BGP.") Fixes: f892474 ("northd: Move connected routes to route engine.") Fixes: 15c9c9f ("northd: Add bfd, static_routes, route_policies and bfd_sync nodes to I-P engine.") Signed-off-by: Ales Musil <amusil@redhat.com>
1 parent 8450f13 commit 558ee0a

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

northd/northd.c

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12238,11 +12238,11 @@ parsed_route_lookup(struct hmap *routes, size_t hash,
1223812238
continue;
1223912239
}
1224012240

12241-
if (pr->nexthop && ipv6_addr_equals(pr->nexthop, new_pr->nexthop)) {
12241+
if (pr->nexthop && !ipv6_addr_equals(pr->nexthop, new_pr->nexthop)) {
1224212242
continue;
1224312243
}
1224412244

12245-
if (memcmp(&pr->prefix, &new_pr->prefix, sizeof(struct in6_addr))) {
12245+
if (!ipv6_addr_equals(&pr->prefix, &new_pr->prefix)) {
1224612246
continue;
1224712247
}
1224812248

@@ -12283,6 +12283,20 @@ parsed_route_lookup(struct hmap *routes, size_t hash,
1228312283
continue;
1228412284
}
1228512285

12286+
if (!sset_equals(&pr->ecmp_selection_fields,
12287+
&new_pr->ecmp_selection_fields)) {
12288+
continue;
12289+
}
12290+
12291+
if (pr->tracked_port != new_pr->tracked_port) {
12292+
continue;
12293+
}
12294+
12295+
if (pr->dynamic_routing_advertise !=
12296+
new_pr->dynamic_routing_advertise) {
12297+
12298+
}
12299+
1228612300
return pr;
1228712301
}
1228812302

@@ -15377,6 +15391,14 @@ route_policies_lookup(struct hmap *route_policies, size_t hash,
1537715391
continue;
1537815392
}
1537915393

15394+
if (rp->chain_id != new_rp->chain_id) {
15395+
continue;
15396+
}
15397+
15398+
if (rp->jump_chain_id != new_rp->jump_chain_id) {
15399+
continue;
15400+
}
15401+
1538015402
if (rp->n_valid_nexthops != new_rp->n_valid_nexthops) {
1538115403
continue;
1538215404
}

0 commit comments

Comments
 (0)