When tracing, always print incoming part of the trace before the outgoing one.
Avoid buffer overflows in `show routes' command.
This commit is contained in:
parent
798df5b1ab
commit
8581061399
1 changed files with 2 additions and 2 deletions
|
@ -284,10 +284,10 @@ rte_recalculate(rtable *table, net *net, struct proto *p, rte *new, ea_list *tmp
|
||||||
|
|
||||||
if (new && rte_better(new, old_best)) /* It's a new optimal route => announce and relink it */
|
if (new && rte_better(new, old_best)) /* It's a new optimal route => announce and relink it */
|
||||||
{
|
{
|
||||||
|
rte_trace_in(D_ROUTES, p, new, "added [best]");
|
||||||
rte_announce(table, net, new, old_best, tmpa);
|
rte_announce(table, net, new, old_best, tmpa);
|
||||||
new->next = net->routes;
|
new->next = net->routes;
|
||||||
net->routes = new;
|
net->routes = new;
|
||||||
rte_trace_in(D_ROUTES, p, new, "added [best]");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -659,7 +659,7 @@ rt_format_via(rte *e, byte *via)
|
||||||
static void
|
static void
|
||||||
rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d)
|
rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d)
|
||||||
{
|
{
|
||||||
byte via[STD_ADDRESS_P_LENGTH+32], from[STD_ADDRESS_P_LENGTH];
|
byte via[STD_ADDRESS_P_LENGTH+32], from[STD_ADDRESS_P_LENGTH+6];
|
||||||
byte tm[TM_RELTIME_BUFFER_SIZE], info[256];
|
byte tm[TM_RELTIME_BUFFER_SIZE], info[256];
|
||||||
rta *a = e->attrs;
|
rta *a = e->attrs;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue