diff options
-rwxr-xr-x | scripts/system/vyatta_update_ntp.pl | 19 |
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; |