diff options
author | sever-sever <v.gletenko@vyos.io> | 2021-02-27 10:43:01 +0000 |
---|---|---|
committer | sever-sever <v.gletenko@vyos.io> | 2021-02-27 11:23:04 +0000 |
commit | fa8267ded85bd403028f66bf59ab5de15be48b41 (patch) | |
tree | 50657112b6215f0f22c686f26cfcb72bd4a6bb06 /src/conf_mode/protocols_bgp.py | |
parent | cf8df2f3995d553e87257a6a748905f888d97941 (diff) | |
download | vyos-1x-fa8267ded85bd403028f66bf59ab5de15be48b41.tar.gz vyos-1x-fa8267ded85bd403028f66bf59ab5de15be48b41.zip |
bgp: T3225: is_addr_assigned should check only ipv4 ipv6 neighbors
Diffstat (limited to 'src/conf_mode/protocols_bgp.py')
-rwxr-xr-x | src/conf_mode/protocols_bgp.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py index 890196b31..7dede74a1 100755 --- a/src/conf_mode/protocols_bgp.py +++ b/src/conf_mode/protocols_bgp.py @@ -20,6 +20,7 @@ from sys import exit from vyos.config import Config from vyos.configdict import dict_merge +from vyos.template import is_ip from vyos.template import render_to_string from vyos.util import call from vyos.util import dict_search @@ -115,8 +116,9 @@ def verify(bgp): if not verify_remote_as(peer_config, asn_config): raise ConfigError(f'Neighbor "{peer}" remote-as must be set!') + # Only checks for ipv4 and ipv6 neighbors # Check if neighbor address is assigned as system interface address - if is_addr_assigned(peer): + if is_ip(peer) and is_addr_assigned(peer): raise ConfigError(f'Can\'t configure local address as neighbor "{peer}"') for afi in ['ipv4_unicast', 'ipv6_unicast', 'l2vpn_evpn']: |