mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 11:48:50 +00:00
Merge pull request #6669 from ton31337/fix/large-community-list-set_sequence
bgpd: Actually find the sequence number for large-community-list
This commit is contained in:
commit
d0e2053724
@ -17332,8 +17332,7 @@ static int lcommunity_list_set_vty(struct vty *vty, int argc,
|
||||
char *cl_name;
|
||||
char *seq = NULL;
|
||||
|
||||
argv_find(argv, argc, "(1-4294967295)", &idx);
|
||||
if (idx)
|
||||
if (argv_find(argv, argc, "(1-4294967295)", &idx))
|
||||
seq = argv[idx]->arg;
|
||||
|
||||
idx = 0;
|
||||
@ -17382,8 +17381,7 @@ static int lcommunity_list_unset_vty(struct vty *vty, int argc,
|
||||
int idx = 0;
|
||||
char *seq = NULL;
|
||||
|
||||
argv_find(argv, argc, "(1-4294967295)", &idx);
|
||||
if (idx)
|
||||
if (argv_find(argv, argc, "(1-4294967295)", &idx))
|
||||
seq = argv[idx]->arg;
|
||||
|
||||
idx = 0;
|
||||
|
16
tools/coccinelle/argv_find.cocci
Normal file
16
tools/coccinelle/argv_find.cocci
Normal file
@ -0,0 +1,16 @@
|
||||
@@
|
||||
identifier idx;
|
||||
identifier argv;
|
||||
identifier argc;
|
||||
expression e1;
|
||||
expression e2;
|
||||
@@
|
||||
|
||||
- argv_find(argv, argc, e1, &idx);
|
||||
if (
|
||||
- idx
|
||||
+ argv_find(argv, argc, e1, &idx)
|
||||
)
|
||||
{
|
||||
e2;
|
||||
}
|
Loading…
Reference in New Issue
Block a user