From 2b5ca0033749741dbbe22eed9bc12b4f64199b0d Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Mon, 11 May 2015 15:17:32 +0100 Subject: [PATCH] functions.m4 (ntpclient): Handle NTP servers with IPv6 addresses. --- functions.m4 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/functions.m4 b/functions.m4 index c8a08c4..765a94d 100644 --- a/functions.m4 +++ b/functions.m4 @@ -301,8 +301,11 @@ ntpclient () { ntpchain=$1; shift clearchain ntp-servers - for ntp; do run iptables -A ntp-servers -j ACCEPT -s $ntp; done - run iptables -A $ntpchain -j ntp-servers \ + for ntp; do + case $ntp in *:*) ipt=ip6tables ;; *) ipt=iptables ;; esac + run $ipt -A ntp-servers -j ACCEPT -s $ntp; + done + run ip46tables -A $ntpchain -j ntp-servers \ -p udp --source-port 123 --destination-port 123 } -- 2.11.0