mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 18:04:03 +00:00
bgpd: Fix usage of uninitialized dn_flag[]
dn_flag was tested inside of a 'use_json' block further down in the function. Move initialization of the value to outside of the !use_json if statement Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
bf97380cf1
commit
517cd68a3e
@ -7337,6 +7337,10 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
|
||||
if (use_json)
|
||||
json_neigh = json_object_new_object();
|
||||
|
||||
memset (dn_flag, '\0', sizeof (dn_flag));
|
||||
if (!p->conf_if && peer_dynamic_neighbor (p))
|
||||
dn_flag[0] = '*';
|
||||
|
||||
if (!use_json)
|
||||
{
|
||||
if (p->conf_if) /* Configured interface name. */
|
||||
@ -7344,13 +7348,7 @@ bgp_show_peer (struct vty *vty, struct peer *p, u_char use_json, json_object *js
|
||||
BGP_PEER_SU_UNSPEC(p) ? "None" :
|
||||
sockunion2str (&p->su, buf, SU_ADDRSTRLEN));
|
||||
else /* Configured IP address. */
|
||||
{
|
||||
memset(dn_flag, '\0', sizeof(dn_flag));
|
||||
if (peer_dynamic_neighbor(p))
|
||||
dn_flag[0] = '*';
|
||||
|
||||
vty_out (vty, "BGP neighbor is %s%s, ", dn_flag, p->host);
|
||||
}
|
||||
}
|
||||
|
||||
if (use_json)
|
||||
|
Loading…
Reference in New Issue
Block a user