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;
}
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);