From af8bffe2d156d7db4bf9abb78878173fc55ee168 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 22 Nov 2009 03:52:52 +0000 Subject: [PATCH] merge ahcpd from trunk to 8.09 SVN-Revision: 18461 --- ipv6/ahcpd/Makefile | 10 ++++------ ipv6/ahcpd/files/ahcpd.config | 5 +++-- ipv6/ahcpd/files/ahcpd.init | 23 +++++++++++++++++++---- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/ipv6/ahcpd/Makefile b/ipv6/ahcpd/Makefile index 18cd6e2c70..995207d2c0 100644 --- a/ipv6/ahcpd/Makefile +++ b/ipv6/ahcpd/Makefile @@ -4,17 +4,16 @@ # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # -# $Id$ include $(TOPDIR)/rules.mk PKG_NAME:=ahcpd -PKG_VERSION:=0.5 -PKG_RELEASE:=1 +PKG_VERSION:=0.50 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.pps.jussieu.fr/~jch/software/files/ -PKG_MD5SUM:=0e5fe1199161eeef214c43eca7eec9a1 +PKG_MD5SUM:=627ec199784c60e5250651f82511fff2 include $(INCLUDE_DIR)/package.mk @@ -53,9 +52,8 @@ endef define Package/ahcpd/install $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/ahcp-generate{,-address} $(1)/usr/bin/ $(INSTALL_DIR) $(1)/usr/lib/ahcp - $(INSTALL_BIN) $(PKG_BUILD_DIR)/ahcp{,-dummy}-config.sh $(1)/usr/lib/ahcp/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ahcp-config.sh $(1)/usr/lib/ahcp/ $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/ahcpd $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/etc/config diff --git a/ipv6/ahcpd/files/ahcpd.config b/ipv6/ahcpd/files/ahcpd.config index 4aca869712..dc9186c6fc 100755 --- a/ipv6/ahcpd/files/ahcpd.config +++ b/ipv6/ahcpd/files/ahcpd.config @@ -1,5 +1,6 @@ config ahcpd option interfaces "wl0" - # Comment out to actually disable, see ticket 3550 + option no_config true option no_dns false - option no_ipv4 true + option ipv4_only false + option ipv6_only false diff --git a/ipv6/ahcpd/files/ahcpd.init b/ipv6/ahcpd/files/ahcpd.init index a885c5477b..5b0fe19658 100644 --- a/ipv6/ahcpd/files/ahcpd.init +++ b/ipv6/ahcpd/files/ahcpd.init @@ -7,19 +7,34 @@ pidfile=/var/run/ahcpd.pid ahcpd_config() { local cfg="$1" config_get interfaces "$cfg" interfaces - config_get no_ipv4 "$cfg" no_ipv4 - config_get no_dns "$cfg" no_dns + config_get_bool no_config "$cfg" no_config 0 + config_get_bool ipv4_only "$cfg" ipv4_only 0 + config_get_bool ipv6_only "$cfg" ipv6_only 0 + config_get_bool no_dns "$cfg" no_dns 0 } start() { config_load ahcpd config_foreach ahcpd_config ahcpd mkdir -p /var/lib - [ -r /usr/lib/ahcp/ahcp.dat ] && authority="-a /usr/lib/ahcp/ahcp.dat" + if [ "$no_config" -eq 0 ]; then + unset no_config + fi + if [ "$ipv4_only" -eq 0 ]; then + unset ipv4_only + fi + if [ "$ipv6_only" -eq 0 ]; then + unset ipv6_only + fi + if [ "$no_dns" -eq 0 ]; then + unset no_dns + fi if [ -e $pidfile ] ; then echo "$pidfile exists -- not starting ahcpd." >&2 else - /usr/sbin/ahcpd -D -I $pidfile ${no_ipv4:+-s} ${no_dns:+-N} $authority $interfaces + /usr/sbin/ahcpd -s /usr/lib/ahcp/ahcp-config.sh -D -I $pidfile \ + ${ipv4_only:+-4} ${ipv6_only:+-6} ${no_dns:+-N} ${no_config:+-n} \ + $interfaces fi } -- 2.30.2