Skip to content

Commit

Permalink
routing: fix support for default gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
cjsworld committed Nov 25, 2022
1 parent ee7ba2c commit 4d7d138
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ofp_rt_mtrie_lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,11 +587,15 @@ ofp_rtl_remove(struct ofp_rtl_tree *tree, uint32_t addr_be, uint32_t masklen)

struct ofp_nh_entry *ofp_rtl_search(struct ofp_rtl_tree *tree, uint32_t addr_be)
{
struct ofp_nh_entry *nh = NULL;
struct ofp_rtl_node *elem, *node = tree->root;
struct ofp_nh_entry *nh = &node->data[0];
uint32_t addr = odp_be_to_cpu_32(addr_be);
uint32_t low = 0, high = IPV4_FIRST_LEVEL;

if (!(nh->flags & OFP_RTL_FLAGS_GATEWAY)) {
nh = NULL;
}

for (; high <= IPV4_LENGTH ; low = high, high += IPV4_LEVEL) {
elem = find_node(node, addr, low, high);

Expand Down

0 comments on commit 4d7d138

Please sign in to comment.