* bgp_attr.c: (bgp_packet_attribute) Remove dead code, Coverity
CID #1
+ * bgp_aspath.{c,h}: (aspath_print_vty) take a format string,
+ so as to reduce burden on callers, all in bgp_route.c
* bgp_route.c: (bgp_static_update_main) Remove useless NULL
check, code already assumes bgp_static can not be NULL,
fixes CID #7.
(bgp_static_update_rsclient) ditto, CID #6
+ (route_vty_out{,tmp}) Update to match aspath_print_vty,
+ simplifying checks needed to get spacing right. CID #4,#5.
+ ({damp,flap}_route_vty_out) Ditto, CID #9, #10
2006-05-08 Paul Jakma <paul.jakma@sun.com>
extern struct aspath *aspath_intern (struct aspath *);
extern void aspath_unintern (struct aspath *);
extern const char *aspath_print (struct aspath *);
-extern void aspath_print_vty (struct vty *, struct aspath *);
+extern void aspath_print_vty (struct vty *, const char *, struct aspath *);
extern void aspath_print_all_vty (struct vty *);
extern unsigned int aspath_key_make (struct aspath *);
extern int aspath_loop_check (struct aspath *, as_t);
vty_out (vty, "%7u ",attr->weight);
- /* Print aspath */
- if (attr->aspath)
- aspath_print_vty (vty, attr->aspath);
+ /* Print aspath */
+ if (attr->aspath)
+ aspath_print_vty (vty, "%s ", attr->aspath);
- /* Print origin */
- if (strlen (attr->aspath->str) == 0)
+ /* Print origin */
vty_out (vty, "%s", bgp_origin_str[attr->origin]);
- else
- vty_out (vty, " %s", bgp_origin_str[attr->origin]);
- }
+ }
vty_out (vty, "%s", VTY_NEWLINE);
}
vty_out (vty, "%7d ",attr->weight);
- /* Print aspath */
- if (attr->aspath)
- aspath_print_vty (vty, attr->aspath);
+ /* Print aspath */
+ if (attr->aspath)
+ aspath_print_vty (vty, "%s ", attr->aspath);
- /* Print origin */
- if (strlen (attr->aspath->str) == 0)
+ /* Print origin */
vty_out (vty, "%s", bgp_origin_str[attr->origin]);
- else
- vty_out (vty, " %s", bgp_origin_str[attr->origin]);
- }
+ }
vty_out (vty, "%s", VTY_NEWLINE);
}
{
/* Print aspath */
if (attr->aspath)
- aspath_print_vty (vty, attr->aspath);
+ aspath_print_vty (vty, "%s ", attr->aspath);
/* Print origin */
- if (strlen (attr->aspath->str) == 0)
- vty_out (vty, "%s", bgp_origin_str[attr->origin]);
- else
- vty_out (vty, " %s", bgp_origin_str[attr->origin]);
+ vty_out (vty, "%s", bgp_origin_str[attr->origin]);
}
vty_out (vty, "%s", VTY_NEWLINE);
}
{
/* Print aspath */
if (attr->aspath)
- aspath_print_vty (vty, attr->aspath);
+ aspath_print_vty (vty, "%s ", attr->aspath);
/* Print origin */
- if (strlen (attr->aspath->str) == 0)
- vty_out (vty, "%s", bgp_origin_str[attr->origin]);
- else
- vty_out (vty, " %s", bgp_origin_str[attr->origin]);
+ vty_out (vty, "%s", bgp_origin_str[attr->origin]);
}
vty_out (vty, "%s", VTY_NEWLINE);
}
if (aspath_count_hops (attr->aspath) == 0)
vty_out (vty, "Local");
else
- aspath_print_vty (vty, attr->aspath);
+ aspath_print_vty (vty, "%s", attr->aspath);
}
if (CHECK_FLAG (binfo->flags, BGP_INFO_REMOVED))