#
-# Copyright (C) 2006-2009 OpenWrt.org
+# Copyright (C) 2006-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
PKG_NAME:=chrony
PKG_VERSION:=1.26
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:= ftp://download.tuxfamily.org/projects/chrony/ \
config_get NTP_SERVERS $CONFIG_SECTION TimeServers
config_get CLIENT_NETWORKS $CONFIG_SECTION ClientAccessFrom
CHRONY_KEY=$(awk '/^1 / { print $2; }' /etc/chrony/chrony.keys)
- include /lib/network
- scan_interfaces
+
+ . /lib/functions/network.sh
# Define servers and do a rapid series of time measurements
# to get up to date
echo password $CHRONY_KEY
echo makestep
for NETNAME in $CLIENT_NETWORKS; do
- local INTERFACE
- local IP
- local NETMASK
- local BROADCAST
- local NETWORK
- local PREFIX
-
- config_get INTERFACE "$NETNAME" ifname
- if [ -n "$INTERFACE" ] ; then
- eval $(ifconfig $INTERFACE | grep inet | sed -e 's/.*addr:/IP=/' -e 's/ .*Mask:/; NETMASK=/')
- eval $(ipcalc.sh $IP $NETMASK)
- echo allow $NETWORK/$PREFIX
+ local subnet
+ if network_get_subnet subnet "$NETNAME"; then
+ echo allow $subnet
fi
done
) | chronyc > /dev/null 2>&1