radvd: update to 1.7 * add RFC6106 DNSSL and clients init script options * add route...
authorStephen Walker <stephendwalker@gmail.com>
Sat, 29 Jan 2011 01:04:03 +0000 (01:04 +0000)
committerStephen Walker <stephendwalker@gmail.com>
Sat, 29 Jan 2011 01:04:03 +0000 (01:04 +0000)
SVN-Revision: 25224

ipv6/radvd/Makefile
ipv6/radvd/files/radvd.config
ipv6/radvd/files/radvd.init
ipv6/radvd/patches/001-fix_avr32_compile [deleted file]

index c88a890fbdc3cdf8bf9d30cc4abfbe6e25b54a76..ee95baba456c1162db4ae8c2974d91b3ababd640 100644 (file)
@@ -1,5 +1,5 @@
 #
-# 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.
@@ -8,13 +8,15 @@
 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
 
@@ -30,21 +32,13 @@ define Package/radvd/description
 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
index 437e3b743f7a69b9a89f644d9e843713dcaccc79..58140dd17aa11e1bdcc576a243d73d903d20d577 100644 (file)
@@ -14,8 +14,23 @@ config prefix
        option AdvRouterAddr    0
        option ignore           1
 
+config route
+       option interface        'lan'
+       option prefix           ''
+       option ignore           1
+
 config rdnss
        option interface        'lan'
        # If not specified, the link-local address of the interface is used
        option addr             ''
        option ignore           1
+
+config dnssl
+       option interface        'lan'
+       option suffix           ''
+       option ignore           1
+
+config clients
+       option interface        'lan'
+       option client           ''
+       option ignore           1
index e49a587e9a14be66fc032d90cb8e4a3a26cd93b2..7e31264d249cf59cbd07e2d3e9842b4574f5e32e 100644 (file)
@@ -9,10 +9,10 @@ RADVD_PREFIX_STRING_OPTIONS='AdvValidLifetime AdvPreferredLifetime'
 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
@@ -255,17 +255,6 @@ radvd_write_route() {
                        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
 
@@ -317,15 +306,77 @@ radvd_write_rdnss() {
                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'
@@ -341,6 +392,8 @@ radvd_write_config() {
        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
@@ -349,6 +402,8 @@ radvd_write_config() {
                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
 
diff --git a/ipv6/radvd/patches/001-fix_avr32_compile b/ipv6/radvd/patches/001-fix_avr32_compile
deleted file mode 100644 (file)
index 050ae28..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---- 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-* \