summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2020-02-17 11:18:32 +0100
committerMaria Matejka <mq@ucw.cz>2021-10-13 19:09:04 +0200
commit3660f19dd534224da4870a507efcef5b36794506 (patch)
tree5e9a79d4cb53d5a90259f2b56c487064e2ff9c0d /nest
parentc507fb41bb2e62f336357121598debab95a7c767 (diff)
Dropping the RTS_DUMMY temporary route storage.
Kernel route sync is done by other ways now and this code is not used currently.
Diffstat (limited to 'nest')
-rw-r--r--nest/config.Y2
-rw-r--r--nest/route.h1
-rw-r--r--nest/rt-attr.c3
-rw-r--r--nest/rt-table.c23
4 files changed, 2 insertions, 27 deletions
diff --git a/nest/config.Y b/nest/config.Y
index 7ead8589..ef3e27c0 100644
--- a/nest/config.Y
+++ b/nest/config.Y
@@ -128,7 +128,7 @@ CF_KEYWORDS(CHECK, LINK)
/* For r_args_channel */
CF_KEYWORDS(IPV4, IPV4_MC, IPV4_MPLS, IPV6, IPV6_MC, IPV6_MPLS, IPV6_SADR, VPN4, VPN4_MC, VPN4_MPLS, VPN6, VPN6_MC, VPN6_MPLS, ROA4, ROA6, FLOW4, FLOW6, MPLS, PRI, SEC)
-CF_ENUM(T_ENUM_RTS, RTS_, DUMMY, STATIC, INHERIT, DEVICE, STATIC_DEVICE, REDIRECT,
+CF_ENUM(T_ENUM_RTS, RTS_, STATIC, INHERIT, DEVICE, STATIC_DEVICE, REDIRECT,
RIP, OSPF, OSPF_IA, OSPF_EXT1, OSPF_EXT2, BGP, PIPE, BABEL)
CF_ENUM(T_ENUM_SCOPE, SCOPE_, HOST, LINK, SITE, ORGANIZATION, UNIVERSE, UNDEFINED)
CF_ENUM(T_ENUM_RTD, RTD_, UNICAST, BLACKHOLE, UNREACHABLE, PROHIBIT)
diff --git a/nest/route.h b/nest/route.h
index 531a4ca8..9dc6a6bd 100644
--- a/nest/route.h
+++ b/nest/route.h
@@ -432,7 +432,6 @@ typedef struct rta {
struct nexthop nh; /* Next hop */
} rta;
-#define RTS_DUMMY 0 /* Dummy route to be removed soon */
#define RTS_STATIC 1 /* Normal static route */
#define RTS_INHERIT 2 /* Route inherited from kernel */
#define RTS_DEVICE 3 /* Device route */
diff --git a/nest/rt-attr.c b/nest/rt-attr.c
index 00744bea..1bece201 100644
--- a/nest/rt-attr.c
+++ b/nest/rt-attr.c
@@ -61,7 +61,6 @@
const adata null_adata; /* adata of length 0 */
const char * const rta_src_names[RTS_MAX] = {
- [RTS_DUMMY] = "",
[RTS_STATIC] = "static",
[RTS_INHERIT] = "inherit",
[RTS_DEVICE] = "device",
@@ -1260,7 +1259,7 @@ rta_do_cow(rta *o, linpool *lp)
void
rta_dump(rta *a)
{
- static char *rts[] = { "RTS_DUMMY", "RTS_STATIC", "RTS_INHERIT", "RTS_DEVICE",
+ static char *rts[] = { "", "RTS_STATIC", "RTS_INHERIT", "RTS_DEVICE",
"RTS_STAT_DEV", "RTS_REDIR", "RTS_RIP",
"RTS_OSPF", "RTS_OSPF_IA", "RTS_OSPF_EXT1",
"RTS_OSPF_EXT2", "RTS_BGP", "RTS_PIPE", "RTS_BABEL" };
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 844c7a68..13af3eaf 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -1385,26 +1385,6 @@ rte_update_unlock(void)
lp_flush(rte_update_pool);
}
-static inline void
-rte_hide_dummy_routes(net *net, rte **dummy)
-{
- if (net->routes && net->routes->attrs->source == RTS_DUMMY)
- {
- *dummy = net->routes;
- net->routes = (*dummy)->next;
- }
-}
-
-static inline void
-rte_unhide_dummy_routes(net *net, rte **dummy)
-{
- if (*dummy)
- {
- (*dummy)->next = net->routes;
- net->routes = *dummy;
- }
-}
-
/**
* rte_update - enter a new update to a routing table
* @table: table to be updated
@@ -1453,7 +1433,6 @@ rte_update2(struct channel *c, const net_addr *n, rte *new, struct rte_src *src)
// struct proto *p = c->proto;
struct proto_stats *stats = &c->stats;
const struct filter *filter = c->in_filter;
- rte *dummy = NULL;
net *nn;
ASSERT(c->channel_state == CS_UP);
@@ -1532,9 +1511,7 @@ rte_update2(struct channel *c, const net_addr *n, rte *new, struct rte_src *src)
recalc:
/* And recalculate the best route */
- rte_hide_dummy_routes(nn, &dummy);
rte_recalculate(c, nn, new, src);
- rte_unhide_dummy_routes(nn, &dummy);
rte_update_unlock();
return;