summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim <UnicronNL@users.noreply.github.com>2017-06-13 13:01:04 +0200
committerGitHub <noreply@github.com>2017-06-13 13:01:04 +0200
commit9d71d68dac2e865838c1bb872004e0cb843b42f1 (patch)
tree78a077c6e43c046f2ea9a8a4e4de9830a0fdcd65
parentd133ba0fcdda4bb1c4a7653e2b275a2a3ec4434b (diff)
parent87266d5b27778af56a814347fdd8926274b9c315 (diff)
downloadvyatta-cfg-system-9d71d68dac2e865838c1bb872004e0cb843b42f1.tar.gz
vyatta-cfg-system-9d71d68dac2e865838c1bb872004e0cb843b42f1.zip
Merge pull request #57 from treacly/current
Fix to generate correct NTP config when specifying ipv6 servers.
-rwxr-xr-xscripts/system/vyatta_update_ntp.pl19
1 files changed, 7 insertions, 12 deletions
diff --git a/scripts/system/vyatta_update_ntp.pl b/scripts/system/vyatta_update_ntp.pl
index 36a2807e..eaaae14a 100755
--- a/scripts/system/vyatta_update_ntp.pl
+++ b/scripts/system/vyatta_update_ntp.pl
@@ -35,19 +35,14 @@ sub ntp_format {
if (defined($ip)) {
my $address = $ip->addr();
my $mask = $ip->mask();
-
- if ($ip->masklen() == 32) {
- if ($ip->version() == 6) {
- return "-6 $address";
- } else {
- return "$address";
- }
+
+ if (
+ ($ip->version() == 6 && $ip->masklen() == 128)
+ || ($ip->version() == 4 && $ip->masklen() == 32)
+ ) {
+ return "$address";
} else {
- if ($ip->version() == 6) {
- return "-6 $address mask $mask";
- } else {
- return "$address mask $mask";
- }
+ return "$address mask $mask";
}
} else {
return undef;