Skip to content

Commit 4d7d138

Browse files
committed
routing: fix support for default gateway
see: OpenFastPath#272
1 parent ee7ba2c commit 4d7d138

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ofp_rt_mtrie_lookup.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,11 +587,15 @@ ofp_rtl_remove(struct ofp_rtl_tree *tree, uint32_t addr_be, uint32_t masklen)
587587

588588
struct ofp_nh_entry *ofp_rtl_search(struct ofp_rtl_tree *tree, uint32_t addr_be)
589589
{
590-
struct ofp_nh_entry *nh = NULL;
591590
struct ofp_rtl_node *elem, *node = tree->root;
591+
struct ofp_nh_entry *nh = &node->data[0];
592592
uint32_t addr = odp_be_to_cpu_32(addr_be);
593593
uint32_t low = 0, high = IPV4_FIRST_LEVEL;
594594

595+
if (!(nh->flags & OFP_RTL_FLAGS_GATEWAY)) {
596+
nh = NULL;
597+
}
598+
595599
for (; high <= IPV4_LENGTH ; low = high, high += IPV4_LEVEL) {
596600
elem = find_node(node, addr, low, high);
597601

0 commit comments

Comments
 (0)