diff options
author | anlan_cs <vic.lan@pica8.com> | 2023-04-14 02:32:32 +0200 |
---|---|---|
committer | anlan_cs <vic.lan@pica8.com> | 2023-04-15 00:42:36 +0200 |
commit | a70895e83ae49b15f13e0801e0743d788b0cb595 (patch) | |
tree | a470435e8ebd755b57ddce1e7008adf0bec8519e /tools | |
parent | Merge pull request #13298 from opensourcerouting/dead-import-check (diff) | |
download | frr-a70895e83ae49b15f13e0801e0743d788b0cb595.tar.xz frr-a70895e83ae49b15f13e0801e0743d788b0cb595.zip |
tools: fix missing remote-as configuration when reload
From commit `411d1a2`, `bgp_delete_nbr_remote_as_line()` is added to
remove some specific bgp neighbors. But, when reloading the following
configuration, it will wrongly remove some good ones:
`neighbor 66.66.66.6 remote-as internal`:
```
router bgp 66
bgp router-id 172.16.204.6
neighbor ANLAN peer-group
neighbor ANLAN remote-as internal
neighbor 66.66.66.6 remote-as internal <- LOST
neighbor 66.66.66.60 peer-group ANLAN
```
The reason is that "66.66.66.6" is included in "66.66.66.60" literally,
then it is mistakenly thought to be a match. Just fix it with
excat match.
Signed-off-by: anlan_cs <vic.lan@pica8.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/frr-reload.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py index 490e519ae..77772f80c 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -850,7 +850,7 @@ def bgp_delete_nbr_remote_as_line(lines_to_add): for pg in pg_dict[ctx_keys[0]]: if pg_dict[ctx_keys[0]][pg]["remoteas"] == True: for nbr in pg_dict[ctx_keys[0]][pg]["nbr"]: - if re_nbr_rmtas.group(1) in nbr: + if re_nbr_rmtas.group(1) == nbr: lines_to_del_from_add.append((ctx_keys, line)) for ctx_keys, line in lines_to_del_from_add: |