summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-10-18 07:12:36 +0200
committerGitHub <noreply@github.com>2019-10-18 07:12:36 +0200
commit1e00f625ca935d72cb719118401fe87261d052ba (patch)
tree10a8e7854271f175aed71bd71df8039479a0a7a4
parent8f2d325e5562da0f2a9c012cea3b2b505d2bc02f (diff)
parent9d984b1ffe12f87bd7144e8f5ee199909bbf6a2a (diff)
downloadvyos-nhrp-1e00f625ca935d72cb719118401fe87261d052ba.tar.gz
vyos-nhrp-1e00f625ca935d72cb719118401fe87261d052ba.zip
Merge pull request #2 from DmitriyEshenko/crux-fix-check
T1742 adding additional check before iptables rules creation
-rw-r--r--scripts/vyos-update-nhrp.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/vyos-update-nhrp.pl b/scripts/vyos-update-nhrp.pl
index c6338fd..35c423c 100644
--- a/scripts/vyos-update-nhrp.pl
+++ b/scripts/vyos-update-nhrp.pl
@@ -458,6 +458,10 @@ sub create_nhrp_iptables {
$config_tun->setLevel("interfaces tunnel");
if ( $config_tun->exists("$tun local-ip")) {
+ if ( $config_tun->exists("$tun remote-ip")) {
+ print ("$tun is not 'mGRE' tunnel'\n");
+ exit 1;
+ }
my $local_ip = $config_tun->returnValue("$tun local-ip");
system ("sudo iptables -N VYOS_NHRP_${tun}_OUT_HOOK") == 0 or die "System call failed: $!";