From 2fe42eae62e8a6ae3c3fcf021d5d22f5e503c0f4 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 29 May 2012 01:47:55 +0000 Subject: [PATCH] [packages] chrony: use network.sh to find subnet SVN-Revision: 31975 --- net/chrony/Makefile | 4 ++-- net/chrony/files/ntpd.init | 19 +++++-------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/net/chrony/Makefile b/net/chrony/Makefile index 7ce3ec330d..dc7b5ad0e5 100644 --- a/net/chrony/Makefile +++ b/net/chrony/Makefile @@ -1,5 +1,5 @@ # -# 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. @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk 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/ \ diff --git a/net/chrony/files/ntpd.init b/net/chrony/files/ntpd.init index dae0184daa..6e742faf38 100644 --- a/net/chrony/files/ntpd.init +++ b/net/chrony/files/ntpd.init @@ -15,8 +15,8 @@ start() { 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 @@ -35,18 +35,9 @@ start() { 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 -- 2.30.2