diff options
| -rw-r--r-- | ospfd/ospfd.c | 2 | ||||
| -rw-r--r-- | zebra/interface.c | 24 | ||||
| -rw-r--r-- | zebra/interface.h | 4 |
3 files changed, 12 insertions, 18 deletions
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index c16798e2fc..c6e24eb776 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -609,7 +609,7 @@ void ospf_finish(struct ospf *ospf) /* Final cleanup of ospf instance */ static void ospf_finish_final(struct ospf *ospf) { - struct vrf *vrf = vrf_lookup_by_id(ospf->vrf_id); + struct vrf *vrf; struct route_node *rn; struct ospf_nbr_nbma *nbr_nbma; struct ospf_lsa *lsa; diff --git a/zebra/interface.c b/zebra/interface.c index 67be781938..ddad9c9e56 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1400,36 +1400,30 @@ static void ifs_dump_brief_vty(struct vty *vty, struct vrf *vrf) vty_out(vty, "\n"); } -char *zebra_protodown_rc_str(enum protodown_reasons protodown_rc, char *pd_buf, - uint32_t pd_buf_len) +const char *zebra_protodown_rc_str(enum protodown_reasons protodown_rc, + char *pd_buf, uint32_t pd_buf_len) { bool first = true; pd_buf[0] = '\0'; - snprintf(pd_buf + strlen(pd_buf), pd_buf_len - strlen(pd_buf), "("); + strlcat(pd_buf, "(", pd_buf_len); if (protodown_rc & ZEBRA_PROTODOWN_EVPN_STARTUP_DELAY) { if (first) first = false; else - snprintf(pd_buf + strlen(pd_buf), - pd_buf_len - strlen(pd_buf), ","); - snprintf(pd_buf + strlen(pd_buf), pd_buf_len - strlen(pd_buf), - "startup-delay"); + strlcat(pd_buf, ",", pd_buf_len); + strlcat(pd_buf, "startup-delay", pd_buf_len); } if (protodown_rc & ZEBRA_PROTODOWN_EVPN_UPLINK_DOWN) { - if (first) - first = false; - else - snprintf(pd_buf + strlen(pd_buf), - pd_buf_len - strlen(pd_buf), ","); - snprintf(pd_buf + strlen(pd_buf), pd_buf_len - strlen(pd_buf), - "uplinks-down"); + if (!first) + strlcat(pd_buf, ",", pd_buf_len); + strlcat(pd_buf, "uplinks-down", pd_buf_len); } - snprintf(pd_buf + strlen(pd_buf), pd_buf_len - strlen(pd_buf), ")"); + strlcat(pd_buf, ")", pd_buf_len); return pd_buf; } diff --git a/zebra/interface.h b/zebra/interface.h index a925dcc962..ab1a245e5e 100644 --- a/zebra/interface.h +++ b/zebra/interface.h @@ -491,8 +491,8 @@ extern bool if_nhg_dependents_is_empty(const struct interface *ifp); extern void vrf_add_update(struct vrf *vrfp); extern void zebra_l2_map_slave_to_bond(struct zebra_if *zif, vrf_id_t vrf); extern void zebra_l2_unmap_slave_from_bond(struct zebra_if *zif); -extern char *zebra_protodown_rc_str(enum protodown_reasons protodown_rc, - char *pd_buf, uint32_t pd_buf_len); +extern const char *zebra_protodown_rc_str(enum protodown_reasons protodown_rc, + char *pd_buf, uint32_t pd_buf_len); #ifdef HAVE_PROC_NET_DEV extern void ifstat_update_proc(void); |
