summaryrefslogtreecommitdiff
path: root/nest/route.h
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2017-04-05 15:11:10 +0200
committerJan Moskyto Matejka <mq@ucw.cz>2017-04-12 16:05:56 +0200
commit7ee07a3c3966ec787bcb7e5100c1add4abef9213 (patch)
tree5cd09824b5c7470e6aa85096c15e23e893fcac24 /nest/route.h
parent97e48b6a18142d1aa11e909d094812f3fff4ea61 (diff)
Nest: Fix route lookup
Diffstat (limited to 'nest/route.h')
-rw-r--r--nest/route.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/nest/route.h b/nest/route.h
index 4d784858..12968cb8 100644
--- a/nest/route.h
+++ b/nest/route.h
@@ -284,6 +284,8 @@ void rt_lock_table(rtable *);
void rt_unlock_table(rtable *);
void rt_setup(pool *, rtable *, char *, struct rtable_config *);
static inline net *net_find(rtable *tab, const net_addr *addr) { return (net *) fib_find(&tab->fib, addr); }
+static inline net *net_find_valid(rtable *tab, const net_addr *addr)
+{ net *n = net_find(tab, addr); return (n && rte_is_valid(n->routes)) ? n : NULL; }
static inline net *net_get(rtable *tab, const net_addr *addr) { return (net *) fib_get(&tab->fib, addr); }
void *net_route(rtable *tab, const net_addr *n);
int net_roa_check(rtable *tab, const net_addr *n, u32 asn);