Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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