From 3ea303b5210bf701df30323933c86f9ffe4d3dd4 Mon Sep 17 00:00:00 2001 From: Tore Anderson Date: Sat, 17 Aug 2024 08:48:06 +0200 Subject: [PATCH] Move plat-fallback-prefix logic into get_plat_prefix() Feature introduced in 8aa8bfa was defective from day one, it seems. Fixes #39 --- clatd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clatd b/clatd index f108404..02e1df3 100755 --- a/clatd +++ b/clatd @@ -374,6 +374,9 @@ sub get_plat_prefix { } if(@prefixes) { return $prefixes[0]; + } elsif($CFG{"plat-fallback-prefix"}) { + p("No PLAT prefix could be discovered, using fallback"); + return $CFG{"plat-fallback-prefix"}; } else { p("No PLAT prefix could be discovered. Your ISP probably doesn't provide", " NAT64/DNS64 PLAT service. Exiting."); @@ -735,7 +738,6 @@ p("Starting clatd v$VERSION by Tore Anderson "); # Step 1: Fill in any essential blanks in the configuration by auto-detecting # any missing values. $CFG{"plat-prefix"} ||= get_plat_prefix(); -$CFG{"plat-prefix"} ||= $CFG{"plat-fallback-prefix"}; if(!$CFG{"plat-prefix"}) { w("No PLAT prefix was discovered or specified; 464XLAT cannot work."); exit 0;