mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-12 03:44:01 +00:00
bgpd: sort vni's in running config
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
6fd8c487e1
commit
568b6b444e
@ -2578,13 +2578,6 @@ static void write_vni_config(struct vty *vty, struct bgpevpn *vpn)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write_vni_config_for_entry(struct hash_backet *backet,
|
|
||||||
struct vty *vty)
|
|
||||||
{
|
|
||||||
struct bgpevpn *vpn = (struct bgpevpn *)backet->data;
|
|
||||||
write_vni_config(vty, vpn);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(HAVE_CUMULUS)
|
#if defined(HAVE_CUMULUS)
|
||||||
DEFUN (bgp_evpn_advertise_default_gw_vni,
|
DEFUN (bgp_evpn_advertise_default_gw_vni,
|
||||||
bgp_evpn_advertise_default_gw_vni_cmd,
|
bgp_evpn_advertise_default_gw_vni_cmd,
|
||||||
@ -4419,6 +4412,15 @@ DEFUN (no_bgp_evpn_vni_rt_without_val,
|
|||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static int vni_cmp(const void **a, const void **b)
|
||||||
|
{
|
||||||
|
const struct bgpevpn *first = *a;
|
||||||
|
const struct bgpevpn *secnd = *b;
|
||||||
|
|
||||||
|
return secnd->vni - first->vni;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Output EVPN configuration information.
|
* Output EVPN configuration information.
|
||||||
*/
|
*/
|
||||||
@ -4427,11 +4429,17 @@ void bgp_config_write_evpn_info(struct vty *vty, struct bgp *bgp, afi_t afi,
|
|||||||
{
|
{
|
||||||
char buf1[RD_ADDRSTRLEN];
|
char buf1[RD_ADDRSTRLEN];
|
||||||
|
|
||||||
if (bgp->vnihash)
|
if (bgp->vnihash) {
|
||||||
hash_iterate(bgp->vnihash,
|
struct list *vnilist = hash_to_list(bgp->vnihash);
|
||||||
(void (*)(struct hash_backet *,
|
struct listnode *ln;
|
||||||
void *))write_vni_config_for_entry,
|
struct bgpevpn *data;
|
||||||
vty);
|
|
||||||
|
list_sort(vnilist, vni_cmp);
|
||||||
|
for (ALL_LIST_ELEMENTS_RO(vnilist, ln, data))
|
||||||
|
write_vni_config(vty, data);
|
||||||
|
|
||||||
|
list_delete_and_null(&vnilist);
|
||||||
|
}
|
||||||
|
|
||||||
if (bgp->advertise_all_vni)
|
if (bgp->advertise_all_vni)
|
||||||
vty_out(vty, " advertise-all-vni\n");
|
vty_out(vty, " advertise-all-vni\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user