summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-02-27 13:18:46 +0100
committerGitHub <noreply@github.com>2021-02-27 13:18:46 +0100
commit1c8280bd894331d76867ed80e95866a6e0b921b6 (patch)
tree50657112b6215f0f22c686f26cfcb72bd4a6bb06 /src/conf_mode
parentcf8df2f3995d553e87257a6a748905f888d97941 (diff)
parentfa8267ded85bd403028f66bf59ab5de15be48b41 (diff)
downloadvyos-1x-1c8280bd894331d76867ed80e95866a6e0b921b6.tar.gz
vyos-1x-1c8280bd894331d76867ed80e95866a6e0b921b6.zip
Merge pull request #751 from sever-sever/T3225
bgp: T3225: is_addr_assigned should check only ipv4 ipv6 neighbors
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/protocols_bgp.py4
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']: