From 9cdab97fd070331c765ed3a0406184815fc566b9 Mon Sep 17 00:00:00 2001 From: Ruben Herold Date: Mon, 15 Jul 2019 23:36:39 +0200 Subject: T1529: Fix detection of interface names --- scripts/bgp/vyatta-bgp.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/bgp/vyatta-bgp.pl b/scripts/bgp/vyatta-bgp.pl index 928f79d1..4d27e02c 100755 --- a/scripts/bgp/vyatta-bgp.pl +++ b/scripts/bgp/vyatta-bgp.pl @@ -1199,8 +1199,9 @@ sub list_peer_groups { sub check_neighbor_ip { my $neighbor = shift; - if ($neighbor =~ /^(\w+)$/) { - exit 0; + my $found = grep { $_ eq $neighbor } Vyatta::Misc::getInterfaces(); + if ($found != 0) { + exit 0; } die "Can't set neighbor address to local system IP.\n" -- cgit v1.2.3