summaryrefslogtreecommitdiff
path: root/nest/rt-attr.c
diff options
context:
space:
mode:
Diffstat (limited to 'nest/rt-attr.c')
-rw-r--r--nest/rt-attr.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/nest/rt-attr.c b/nest/rt-attr.c
index e5d87b53..a892bfd5 100644
--- a/nest/rt-attr.c
+++ b/nest/rt-attr.c
@@ -70,6 +70,11 @@ struct ea_class ea_gen_preference = {
.type = T_INT,
};
+struct ea_class ea_gen_from = {
+ .name = "from",
+ .type = T_IP,
+};
+
const char * const rta_src_names[RTS_MAX] = {
[RTS_STATIC] = "static",
[RTS_INHERIT] = "inherit",
@@ -1229,9 +1234,7 @@ rta_hash(rta *a)
#define MIX(f) mem_hash_mix(&h, &(a->f), sizeof(a->f));
#define BMIX(f) mem_hash_mix_num(&h, a->f);
MIX(hostentry);
- MIX(from);
BMIX(source);
- BMIX(scope);
BMIX(dest);
#undef MIX
@@ -1242,9 +1245,7 @@ static inline int
rta_same(rta *x, rta *y)
{
return (x->source == y->source &&
- x->scope == y->scope &&
x->dest == y->dest &&
- ipa_equal(x->from, y->from) &&
x->hostentry == y->hostentry &&
nexthop_same(&(x->nh), &(y->nh)) &&
ea_same(x->eattrs, y->eattrs));
@@ -1393,12 +1394,11 @@ rta_dump(rta *a)
"RTS_OSPF_EXT2", "RTS_BGP", "RTS_PIPE", "RTS_BABEL" };
static char *rtd[] = { "", " DEV", " HOLE", " UNREACH", " PROHIBIT" };
- debug("uc=%d %s %s%s h=%04x",
- a->uc, rts[a->source], ip_scope_text(a->scope),
+ debug("uc=%d %s %s h=%04x",
+ a->uc, rts[a->source],
rtd[a->dest], a->hash_key);
if (!a->cached)
debug(" !CACHED");
- debug(" <-%I", a->from);
if (a->dest == RTD_UNICAST)
for (struct nexthop *nh = &(a->nh); nh; nh = nh->next)
{
@@ -1441,7 +1441,7 @@ rta_dump_all(void)
void
rta_show(struct cli *c, rta *a)
{
- cli_printf(c, -1008, "\tType: %s %s", rta_src_names[a->source], ip_scope_text(a->scope));
+ cli_printf(c, -1008, "\tType: %s", rta_src_names[a->source]);
for(ea_list *eal = a->eattrs; eal; eal=eal->next)
for(int i=0; i<eal->count; i++)
@@ -1475,6 +1475,7 @@ rta_init(void)
ea_register_init(&ea_gen_preference);
ea_register_init(&ea_gen_igp_metric);
+ ea_register_init(&ea_gen_from);
}
/*