diff options
-rw-r--r-- | nest/route.h | 8 | ||||
-rw-r--r-- | nest/rt-table.c | 4 | ||||
-rw-r--r-- | proto/static/static.c | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/nest/route.h b/nest/route.h index 0634ab7..c41ebf6 100644 --- a/nest/route.h +++ b/nest/route.h @@ -319,10 +319,10 @@ typedef struct rta { protocol-specific metric is availabe */ static inline struct fib *rt_fib(rtable *tab, int cast) { return (cast == RTC_MULTICAST) ? &tab->fib_multicast : &tab->fib_unicast; } -static inline net *net_find2(rtable *tab, ip_addr addr, unsigned len, int cast) { return (net *) fib_find(rt_fib(tab, cast), &addr, len); } -static inline net *net_find(rtable *tab, ip_addr addr, unsigned len) { return net_find2(tab, addr, len, RTC_UNICAST); } -static inline net *net_get2(rtable *tab, ip_addr addr, unsigned len, int cast) { return (net *) fib_get(rt_fib(tab, cast), &addr, len); } -static inline net *net_get(rtable *tab, ip_addr addr, unsigned len) { return net_get2(tab, addr, len, RTC_UNICAST); } +static inline net *net_find_cast(rtable *tab, ip_addr addr, unsigned len, int cast) { return (net *) fib_find(rt_fib(tab, cast), &addr, len); } +static inline net *net_find(rtable *tab, ip_addr addr, unsigned len) { return net_find_cast(tab, addr, len, RTC_UNICAST); } +static inline net *net_get_cast(rtable *tab, ip_addr addr, unsigned len, int cast) { return (net *) fib_get(rt_fib(tab, cast), &addr, len); } +static inline net *net_get(rtable *tab, ip_addr addr, unsigned len) { return net_get_cast(tab, addr, len, RTC_UNICAST); } /* diff --git a/nest/rt-table.c b/nest/rt-table.c index 5d17ca0..1303843 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -1838,8 +1838,8 @@ rt_show(struct rt_show_data *d) } else { - n = net_find2(d->table, d->prefix, d->pxlen, RTC_UNICAST); - n2 = net_find2(d->table, d->prefix, d->pxlen, RTC_MULTICAST); + n = net_find_cast(d->table, d->prefix, d->pxlen, RTC_UNICAST); + n2 = net_find_cast(d->table, d->prefix, d->pxlen, RTC_MULTICAST); } if (n || n2) { diff --git a/proto/static/static.c b/proto/static/static.c index e15a43b..07dafa3 100644 --- a/proto/static/static.c +++ b/proto/static/static.c @@ -56,7 +56,7 @@ static_install(struct proto *p, struct static_route *r, struct iface *ifa) a.iface = ifa; aa = rta_lookup(&a); - n = net_get2(p->table, r->net, r->masklen, r->cast); + n = net_get_cast(p->table, r->net, r->masklen, r->cast); e = rte_get_temp(aa); e->net = n; e->pflags = 0; @@ -73,7 +73,7 @@ static_remove(struct proto *p, struct static_route *r) return; DBG("Removing static route %I/%d%s\n", r->net, r->masklen, (r->cast == RTC_MULTICAST) ? ", multicast" : ""); - n = net_find2(p->table, r->net, r->masklen, r->cast); + n = net_find_cast(p->table, r->net, r->masklen, r->cast); if (n) rte_update(p->table, n, p, p, NULL); r->installed = 0; |