mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 01:15:12 +00:00
bgpd: Fix off-by-one in clear [ip] bgp...
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
268316d185
commit
5daa3e5e59
@ -6064,19 +6064,23 @@ DEFUN (clear_ip_bgp_all,
|
|||||||
/* afi safi */
|
/* afi safi */
|
||||||
idx_afi = idx_clr_sort + 1;
|
idx_afi = idx_clr_sort + 1;
|
||||||
idx_safi = idx_clr_sort + 2;
|
idx_safi = idx_clr_sort + 2;
|
||||||
bgp_get_argv_afi_safi (argc, argv, idx_afi, idx_safi, &afi, &safi, &idx_soft_in_out);
|
idx_soft_in_out = 0;
|
||||||
|
if (argc > idx_afi)
|
||||||
|
bgp_get_argv_afi_safi (argc, argv, idx_afi, idx_safi, &afi, &safi, &idx_soft_in_out);
|
||||||
|
|
||||||
/* soft, soft in, or soft out */
|
clr_type = BGP_CLEAR_SOFT_NONE;
|
||||||
if (strmatch(argv[idx_soft_in_out]->text, "in"))
|
if (idx_soft_in_out && argc > idx_soft_in_out)
|
||||||
clr_type = BGP_CLEAR_SOFT_IN;
|
{
|
||||||
else if (strmatch(argv[idx_soft_in_out]->text, "out"))
|
/* soft, soft in, or soft out */
|
||||||
clr_type = BGP_CLEAR_SOFT_OUT;
|
if (strmatch(argv[idx_soft_in_out]->text, "in"))
|
||||||
else if (strmatch(argv[idx_soft_in_out]->text, "soft"))
|
clr_type = BGP_CLEAR_SOFT_IN;
|
||||||
clr_type = BGP_CLEAR_SOFT_BOTH;
|
else if (strmatch(argv[idx_soft_in_out]->text, "out"))
|
||||||
else if (strmatch(argv[idx_soft_in_out]->text, "prefix-filter"))
|
clr_type = BGP_CLEAR_SOFT_OUT;
|
||||||
clr_type = BGP_CLEAR_SOFT_IN_ORF_PREFIX;
|
else if (strmatch(argv[idx_soft_in_out]->text, "soft"))
|
||||||
else
|
clr_type = BGP_CLEAR_SOFT_BOTH;
|
||||||
clr_type = BGP_CLEAR_SOFT_NONE;
|
else if (strmatch(argv[idx_soft_in_out]->text, "prefix-filter"))
|
||||||
|
clr_type = BGP_CLEAR_SOFT_IN_ORF_PREFIX;
|
||||||
|
}
|
||||||
|
|
||||||
return bgp_clear_vty (vty, vrf, afi, safi, clr_sort, clr_type, clr_arg);
|
return bgp_clear_vty (vty, vrf, afi, safi, clr_sort, clr_type, clr_arg);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user