During backporting attribute changes from 3.0-branch, some internal
attributes (RIP iface and Babel seqno) leaked to 'show route all' output.
Allow protocols to hide specific attributes with GA_HIDDEN value.
Thanks to Nigel Kukard for the bugreport.
#define GA_UNKNOWN 0 /* Attribute not recognized */
#define GA_NAME 1 /* Result = name */
#define GA_FULL 2 /* Result = both name and value */
+#define GA_HIDDEN 3 /* Attribute should not be printed */
/*
* Known protocols
bsprintf(pos, "<type %02x>", e->type);
}
}
- cli_printf(c, -1012, "\t%s", buf);
+
+ if (status != GA_HIDDEN)
+ cli_printf(c, -1012, "\t%s", buf);
}
/**
{
switch (a->id)
{
- case EA_BABEL_SEQNO:
- return GA_FULL;
-
case EA_BABEL_METRIC:
bsprintf(buf, "metric: %d", a->u.data);
return GA_FULL;
return GA_FULL;
}
+ case EA_BABEL_SEQNO:
+ return GA_HIDDEN;
+
default:
return GA_UNKNOWN;
}
bsprintf(buf, "tag: %04x", a->u.data);
return GA_FULL;
+ case EA_RIP_FROM:
+ return GA_HIDDEN;
+
default:
return GA_UNKNOWN;
}