mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-08 12:18:42 +00:00
Dropping the RTS_DUMMY temporary route storage.
Kernel route sync is done by other ways now and this code is not used currently.
This commit is contained in:
parent
c507fb41bb
commit
3660f19dd5
@ -1691,7 +1691,7 @@ Common route attributes are:
|
|||||||
|
|
||||||
<tag><label id="rta-source"><m/enum/ source</tag>
|
<tag><label id="rta-source"><m/enum/ source</tag>
|
||||||
what protocol has told me about this route. Possible values:
|
what protocol has told me about this route. Possible values:
|
||||||
<cf/RTS_DUMMY/, <cf/RTS_STATIC/, <cf/RTS_INHERIT/, <cf/RTS_DEVICE/,
|
<cf/RTS_STATIC/, <cf/RTS_INHERIT/, <cf/RTS_DEVICE/,
|
||||||
<cf/RTS_RIP/, <cf/RTS_OSPF/, <cf/RTS_OSPF_IA/, <cf/RTS_OSPF_EXT1/,
|
<cf/RTS_RIP/, <cf/RTS_OSPF/, <cf/RTS_OSPF_IA/, <cf/RTS_OSPF_EXT1/,
|
||||||
<cf/RTS_OSPF_EXT2/, <cf/RTS_BGP/, <cf/RTS_PIPE/, <cf/RTS_BABEL/.
|
<cf/RTS_OSPF_EXT2/, <cf/RTS_BGP/, <cf/RTS_PIPE/, <cf/RTS_BABEL/.
|
||||||
|
|
||||||
|
@ -378,7 +378,6 @@ bt_test_suite(t_ip_set, "Testing sets of ip address");
|
|||||||
|
|
||||||
function t_enum()
|
function t_enum()
|
||||||
{
|
{
|
||||||
bt_assert(format(RTS_DUMMY) = "(enum 30)0");
|
|
||||||
bt_assert(format(RTS_STATIC) = "(enum 30)1");
|
bt_assert(format(RTS_STATIC) = "(enum 30)1");
|
||||||
bt_assert(format(NET_IP4) = "(enum 36)1");
|
bt_assert(format(NET_IP4) = "(enum 36)1");
|
||||||
bt_assert(format(NET_VPN6) = "(enum 36)4");
|
bt_assert(format(NET_VPN6) = "(enum 36)4");
|
||||||
|
@ -128,7 +128,7 @@ CF_KEYWORDS(CHECK, LINK)
|
|||||||
/* For r_args_channel */
|
/* 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_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)
|
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_SCOPE, SCOPE_, HOST, LINK, SITE, ORGANIZATION, UNIVERSE, UNDEFINED)
|
||||||
CF_ENUM(T_ENUM_RTD, RTD_, UNICAST, BLACKHOLE, UNREACHABLE, PROHIBIT)
|
CF_ENUM(T_ENUM_RTD, RTD_, UNICAST, BLACKHOLE, UNREACHABLE, PROHIBIT)
|
||||||
|
@ -432,7 +432,6 @@ typedef struct rta {
|
|||||||
struct nexthop nh; /* Next hop */
|
struct nexthop nh; /* Next hop */
|
||||||
} rta;
|
} rta;
|
||||||
|
|
||||||
#define RTS_DUMMY 0 /* Dummy route to be removed soon */
|
|
||||||
#define RTS_STATIC 1 /* Normal static route */
|
#define RTS_STATIC 1 /* Normal static route */
|
||||||
#define RTS_INHERIT 2 /* Route inherited from kernel */
|
#define RTS_INHERIT 2 /* Route inherited from kernel */
|
||||||
#define RTS_DEVICE 3 /* Device route */
|
#define RTS_DEVICE 3 /* Device route */
|
||||||
|
@ -61,7 +61,6 @@
|
|||||||
const adata null_adata; /* adata of length 0 */
|
const adata null_adata; /* adata of length 0 */
|
||||||
|
|
||||||
const char * const rta_src_names[RTS_MAX] = {
|
const char * const rta_src_names[RTS_MAX] = {
|
||||||
[RTS_DUMMY] = "",
|
|
||||||
[RTS_STATIC] = "static",
|
[RTS_STATIC] = "static",
|
||||||
[RTS_INHERIT] = "inherit",
|
[RTS_INHERIT] = "inherit",
|
||||||
[RTS_DEVICE] = "device",
|
[RTS_DEVICE] = "device",
|
||||||
@ -1260,7 +1259,7 @@ rta_do_cow(rta *o, linpool *lp)
|
|||||||
void
|
void
|
||||||
rta_dump(rta *a)
|
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_STAT_DEV", "RTS_REDIR", "RTS_RIP",
|
||||||
"RTS_OSPF", "RTS_OSPF_IA", "RTS_OSPF_EXT1",
|
"RTS_OSPF", "RTS_OSPF_IA", "RTS_OSPF_EXT1",
|
||||||
"RTS_OSPF_EXT2", "RTS_BGP", "RTS_PIPE", "RTS_BABEL" };
|
"RTS_OSPF_EXT2", "RTS_BGP", "RTS_PIPE", "RTS_BABEL" };
|
||||||
|
@ -1385,26 +1385,6 @@ rte_update_unlock(void)
|
|||||||
lp_flush(rte_update_pool);
|
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
|
* rte_update - enter a new update to a routing table
|
||||||
* @table: table to be updated
|
* @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 *p = c->proto;
|
||||||
struct proto_stats *stats = &c->stats;
|
struct proto_stats *stats = &c->stats;
|
||||||
const struct filter *filter = c->in_filter;
|
const struct filter *filter = c->in_filter;
|
||||||
rte *dummy = NULL;
|
|
||||||
net *nn;
|
net *nn;
|
||||||
|
|
||||||
ASSERT(c->channel_state == CS_UP);
|
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:
|
recalc:
|
||||||
/* And recalculate the best route */
|
/* And recalculate the best route */
|
||||||
rte_hide_dummy_routes(nn, &dummy);
|
|
||||||
rte_recalculate(c, nn, new, src);
|
rte_recalculate(c, nn, new, src);
|
||||||
rte_unhide_dummy_routes(nn, &dummy);
|
|
||||||
|
|
||||||
rte_update_unlock();
|
rte_update_unlock();
|
||||||
return;
|
return;
|
||||||
|
@ -144,7 +144,7 @@ orta_compare(const struct ospf_proto *p, const orta *new, const orta *old)
|
|||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (old->type == RTS_DUMMY)
|
if (!old->type)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* Prefer intra-area to inter-area to externals */
|
/* Prefer intra-area to inter-area to externals */
|
||||||
@ -195,7 +195,7 @@ orta_compare_asbr(const struct ospf_proto *p, const orta *new, const orta *old)
|
|||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (old->type == RTS_DUMMY)
|
if (!old->type)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (!p->rfc1583)
|
if (!p->rfc1583)
|
||||||
@ -225,7 +225,7 @@ orta_compare_ext(const struct ospf_proto *p, const orta *new, const orta *old)
|
|||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (old->type == RTS_DUMMY)
|
if (!old->type)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* 16.4 (6a) - prefer routes with lower type */
|
/* 16.4 (6a) - prefer routes with lower type */
|
||||||
|
@ -1305,8 +1305,6 @@ nl_send_route(struct krt_proto *p, rte *e, int op, int dest, struct nexthop *nh)
|
|||||||
|
|
||||||
if (p->af == AF_MPLS)
|
if (p->af == AF_MPLS)
|
||||||
priority = 0;
|
priority = 0;
|
||||||
else if (a->source == RTS_DUMMY)
|
|
||||||
priority = e->u.krt.metric;
|
|
||||||
else if (KRT_CF->sys.metric)
|
else if (KRT_CF->sys.metric)
|
||||||
priority = KRT_CF->sys.metric;
|
priority = KRT_CF->sys.metric;
|
||||||
else if ((op != NL_OP_DELETE) && (ea = ea_find(eattrs, EA_KRT_METRIC)))
|
else if ((op != NL_OP_DELETE) && (ea = ea_find(eattrs, EA_KRT_METRIC)))
|
||||||
|
Loading…
Reference in New Issue
Block a user