From fa8267ded85bd403028f66bf59ab5de15be48b41 Mon Sep 17 00:00:00 2001 From: sever-sever Date: Sat, 27 Feb 2021 10:43:01 +0000 Subject: bgp: T3225: is_addr_assigned should check only ipv4 ipv6 neighbors --- src/conf_mode/protocols_bgp.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/conf_mode') 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']: -- cgit v1.2.3