From 65d1de7c991aa4779f46400c8af9a7239ac908c6 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 29 May 2012 00:54:02 +0000 Subject: [PATCH] djbdns: use network.sh to find ip addresses SVN-Revision: 31965 --- net/djbdns/Makefile | 4 ++-- net/djbdns/files/axfrdns.init | 7 +++---- net/djbdns/files/dnscache.init | 13 ++++++------- net/djbdns/files/rbldns.init | 7 +++---- net/djbdns/files/tinydns.init | 7 +++---- net/djbdns/files/walldns.init | 7 +++---- 6 files changed, 20 insertions(+), 25 deletions(-) diff --git a/net/djbdns/Makefile b/net/djbdns/Makefile index bd10145c7..b47450c7c 100644 --- a/net/djbdns/Makefile +++ b/net/djbdns/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 OpenWrt.org +# Copyright (C) 2007-2012 OpenWrt.org # Original port by FreeWRT project. # # 2007 Alexander Tsvyashchenko Adapted FreeWRT port for OpenWRT (Trac ticket 2497) @@ -14,7 +14,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=djbdns PKG_VERSION:=1.05 -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_SOURCE:=${PKG_NAME}-${PKG_VERSION}.tar.gz PKG_SOURCE_URL:=http://cr.yp.to/djbdns/ diff --git a/net/djbdns/files/axfrdns.init b/net/djbdns/files/axfrdns.init index b797141b0..a40f93a8b 100644 --- a/net/djbdns/files/axfrdns.init +++ b/net/djbdns/files/axfrdns.init @@ -1,5 +1,5 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2007 OpenWrt.org +# Copyright (C) 2007-2012 OpenWrt.org # # version 20090401 jhalfmoon @@ -46,9 +46,8 @@ start_daemon() { # Unset AXFR if it is empty [ -z $AXFR ] && export -n AXFR # Translate listening interfaces to ip addresses - include /lib/network - scan_interfaces - config_get IP "$iface" ipaddr + . /lib/functions/network.sh + network_get_ipaddr IP "$iface" || return 1 export ROOT if [ "$DEBUG" == 1 ] ; then $DAEMON -vDRHl0 -c40 -b10 -x $ROOT/tcp.cdb -- $IP 53 $APP diff --git a/net/djbdns/files/dnscache.init b/net/djbdns/files/dnscache.init index 8ba964596..97f8ee9d3 100644 --- a/net/djbdns/files/dnscache.init +++ b/net/djbdns/files/dnscache.init @@ -1,5 +1,5 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2007 OpenWrt.org +# Copyright (C) 2007-2012 OpenWrt.org # Preferably start dnscache after udhcpd/dnsmasq, to be sure /etc/resolv.conf is set correctly. dnsmasq is at S60, so dnscache is put at S65 as seen below. If /etc/resolv.conf is not used, then dnscache may be started at S47, just after the firewall has been set up. START=65 @@ -55,11 +55,10 @@ start_dnscache() { config_list_foreach "$cfg" "ignoreip" append_ignore fi # Add some interface network addresses to list of allowed IP addresses (assumes /24 networks) - include /lib/network - scan_interfaces + . /lib/functions/network.sh if [ -n "$defaultallowif" ] ; then for myinterface in `echo $defaultallowif`; do - config_get addr $myinterface ipaddr + network_get_ipaddr addr $myinterface || continue # the next line strips the last octet from the ip address addr=`echo $addr|sed 's/.[0-9]\+$//'` touch $ROOT/ip/$addr @@ -67,9 +66,9 @@ start_dnscache() { done fi # Translate listen interface names to IP addresses - config_get IP "$iface" ipaddr -# Translante send interface name to an IP address - config_get IPSEND "$ifacesend" ipaddr + network_get_ipaddr IP "$iface" +# Translate send interface name to an IP address + network_get_ipaddr IPSEND "$ifacesend" # Unset HIDETTL if equal to 0 if [ "$HIDETTL" == "0" ] ; then export -n HIDETTL diff --git a/net/djbdns/files/rbldns.init b/net/djbdns/files/rbldns.init index 0c259c639..dfe98f468 100644 --- a/net/djbdns/files/rbldns.init +++ b/net/djbdns/files/rbldns.init @@ -1,5 +1,5 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2007 OpenWrt.org +# Copyright (C) 2007-2012 OpenWrt.org # # version 20090401 jhalfmoon @@ -40,9 +40,8 @@ start_daemon() { # Unset BASE if it is empty [ -z $BASE ] && export -n BASE # Translate listening interfaces to ip addresses - include /lib/network - scan_interfaces - config_get IP "$iface" ipaddr + . /lib/functions/network.sh + network_get_ipaddr IP "$iface" export ROOT if [ "$DEBUG" == 1 ] ; then $DAEMON diff --git a/net/djbdns/files/tinydns.init b/net/djbdns/files/tinydns.init index 30c5d6fea..bff119d59 100644 --- a/net/djbdns/files/tinydns.init +++ b/net/djbdns/files/tinydns.init @@ -1,5 +1,5 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2007 OpenWrt.org +# Copyright (C) 2007-2012 OpenWrt.org # # version 20090401 jhalfmoon @@ -35,10 +35,9 @@ start_daemon() { local cfg="$1" config_get logging "$cfg" logging config_get iface "$cfg" interface - include /lib/network - scan_interfaces # Translate listening interfaces to ip addresses - config_get IP "$iface" ipaddr + . /lib/functions/network.sh + network_get_ipaddr IP "$iface" export ROOT if [ "$DEBUG" == 1 ] ; then $DAEMON diff --git a/net/djbdns/files/walldns.init b/net/djbdns/files/walldns.init index d5d714ff3..9d4f7731a 100644 --- a/net/djbdns/files/walldns.init +++ b/net/djbdns/files/walldns.init @@ -1,5 +1,5 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2007 OpenWrt.org +# Copyright (C) 2007-2012 OpenWrt.org # # version 20090401 jhalfmoon @@ -34,9 +34,8 @@ start_daemon() { config_get logging "$cfg" logging config_get iface "$cfg" interface # Translate listening interfaces to ip addresses - include /lib/network - scan_interfaces - config_get IP "$iface" ipaddr + . /lib/functions/network.sh + network_get_ipaddr IP "$iface" export ROOT if [ "$DEBUG" == 1 ] ; then $DAEMON -- 2.30.2