#
-# Copyright (C) 2006-2009 OpenWrt.org
+# Copyright (C) 2006-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=radvd
-PKG_VERSION:=1.6
+PKG_VERSION:=1.7
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://v6web.litech.org/radvd/dist \
http://download.sourcemage.org/mirror
-PKG_MD5SUM:=987e0660d68b4501b24dc5a068cea83c
+PKG_MD5SUM:=5ec417bde33964a07231ddf6353177c8
+
+PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
IPv6 Routing Advertisement Daemon.
endef
-define Build/Configure
- $(call Build/Configure/Default,\
- --with-configfile=/etc/radvd.conf \
- --with-logfile=/var/log/radvd.log \
- --with-pidfile=/var/run/radvd.pid \
- )
-endef
+CONFIGURE_ARGS += \
+ --with-configfile=/etc/radvd.conf \
+ --with-logfile=/var/log/radvd.log \
+ --with-pidfile=/var/run/radvd.pid
-define Build/Compile
- $(MAKE) -C $(PKG_BUILD_DIR) \
- radvd_LDADD=""
- $(MAKE) -C $(PKG_BUILD_DIR) \
- DESTDIR="$(PKG_INSTALL_DIR)" \
- install
-endef
+MAKE_FLAGS += \
+ radvd_LDADD=""
define Package/radvd/conffiles
/etc/config/radvd
RADVD_PREFIX_BOOLEAN_OPTIONS='AdvOnLink AdvAutonomous AdvRouterAddr'
RADVD_ROUTE_STRING_OPTIONS='AdvRouteLifetime AdvRoutePreference'
-RADVD_ROUTE_BOOLEAN_OPTIONS=''
-RADVD_RDNSS_STRING_OPTIONS='AdvRDNSSPreference AdvRDNSSLifetime'
-RADVD_RDNSS_BOOLEAN_OPTIONS='AdvRDNSSOpen'
+RADVD_RDNSS_STRING_OPTIONS='AdvRDNSSLifetime'
+
+RADVD_DNSSL_STRING_OPTIONS='AdvDNSSLLifetime'
validate_varname() {
local varname=$1
printf '\t\t%s %s;\n' "$name" "$value"
done
- for name in $RADVD_ROUTE_BOOLEAN_OPTIONS; do
- config_get value "$cfg" "$name"
- [ -z "$value" ] && continue
- config_get_bool value "$cfg" "$name" 0
- if [ "$value" -ne 0 ]; then
- printf '\t\t%s on;\n' "$name"
- else
- printf '\t\t%s off;\n' "$name"
- fi
- done
-
printf '\t};\n'
done
printf '\t\t%s %s;\n' "$name" "$value"
done
- for name in $RADVD_RDNSS_BOOLEAN_OPTIONS; do
+ printf '\t};\n'
+
+ return 0
+}
+
+radvd_write_dnssl() {
+ local cfg=$1
+ validate_varname "$cfg" || return 0
+ local ignore
+ local interfaces
+ local interface
+ local suffixes
+ local suffix
+ local suffix_list
+ local name
+ local value
+
+ config_get_bool ignore "$cfg" ignore 0
+ [ "$ignore" -ne 0 ] && return 0
+
+ config_get interfaces "$cfg" interface
+ exist=0
+ for interface in $interfaces; do
+ [ "$INTERFACE" = "$interface" ] && exist=1
+ done
+ [ "$exist" -eq 0 ] && return 0
+
+ config_get suffixes "$cfg" suffix
+ for suffix in $suffixes; do
+ validate_radvd_string "$suffix" || continue
+ suffix_list="$suffix_list $suffix"
+ done
+
+ printf '\n\tDNSSL%s\n\t{\n' "$suffix_list"
+
+ for name in $RADVD_DNSSL_STRING_OPTIONS; do
config_get value "$cfg" "$name"
- [ -z "$value" ] && continue
- config_get_bool value "$cfg" "$name" 0
- if [ "$value" -ne 0 ]; then
- printf '\t\t%s on;\n' "$name"
- else
- printf '\t\t%s off;\n' "$name"
- fi
+ validate_radvd_string "$value" || continue
+ printf '\t\t%s %s;\n' "$name" "$value"
+ done
+
+ printf '\t};\n'
+
+ return 0
+}
+
+radvd_write_clients() {
+ local cfg=$1
+ validate_varname "$cfg" || return 0
+ local ignore
+ local interfaces
+ local interface
+ local clients
+ local client
+
+ config_get_bool ignore "$cfg" ignore 0
+ [ "$ignore" -ne 0 ] && return 0
+
+ config_get interfaces "$cfg" interface
+ exist=0
+ for interface in $interfaces; do
+ [ "$INTERFACE" = "$interface" ] && exist=1
+ done
+ [ "$exist" -eq 0 ] && return 0
+
+ printf '\n\tclients\n\t{\n'
+
+ config_get clients "$cfg" client
+ for client in $clients; do
+ validate_ip6addr "$client" || continue
+ printf '\t\t%s;\n' "$client"
done
printf '\t};\n'
config_foreach radvd_add_interface prefix
config_foreach radvd_add_interface route
config_foreach radvd_add_interface RDNSS
+ config_foreach radvd_add_interface DNSSL
+ config_foreach radvd_add_interface clients
for INTERFACE in $RADVD_INTERFACES; do
IFNAME=$(get_ifname "$INTERFACE") || continue
config_foreach radvd_write_prefix prefix
config_foreach radvd_write_route route
config_foreach radvd_write_rdnss rdnss
+ config_foreach radvd_write_dnssl dnssl
+ config_foreach radvd_write_clients clients
printf '};\n\n'
done
+++ /dev/null
---- a/config.sub
-+++ b/config.sub
-@@ -228,7 +228,7 @@ case $basic_machine in
- | a29k \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
-- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
-+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
- | c4x | clipper \
- | d10v | d30v | dsp16xx \
- | fr30 \
-@@ -282,7 +282,7 @@ case $basic_machine in
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armv*-* \
-- | avr-* \
-+ | avr-* | avr32-* \
- | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c54x-* \
- | clipper-* | cray2-* | cydra-* \