Update odhcp6c from Barrier Breaker (r41447)

Besides other issues, this should fix an integer overflow breaking IPv6 address
aquisition after a runtime of 50 days.
This commit is contained in:
Matthias Schiffer 2014-07-01 20:47:21 +02:00
parent cecb94d25d
commit e234c1eddb

View File

@ -1,18 +1,18 @@
From: Matthias Schiffer <mschiffer@universe-factory.net> From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sat, 11 Jan 2014 11:47:58 +0100 Date: Sat, 11 Jan 2014 11:47:58 +0100
Subject: Update odhcp6c from Barrier Breaker Subject: Update odhcp6c from Barrier Breaker (r41447)
diff --git a/package/odhcp6c/Makefile b/package/odhcp6c/Makefile diff --git a/package/odhcp6c/Makefile b/package/odhcp6c/Makefile
index e767064..f18e7fa 100644 index e767064..7ad9bd2 100644
--- a/package/odhcp6c/Makefile --- a/package/odhcp6c/Makefile
+++ b/package/odhcp6c/Makefile +++ b/package/odhcp6c/Makefile
@@ -8,26 +8,37 @@ @@ -8,26 +8,55 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=odhcp6c PKG_NAME:=odhcp6c
-PKG_VERSION:=2013-10-02 -PKG_VERSION:=2013-10-02
-PKG_RELEASE=$(PKG_SOURCE_VERSION)-1 -PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
+PKG_VERSION:=2014-04-09 +PKG_VERSION:=2014-06-04
+PKG_RELEASE=$(PKG_SOURCE_VERSION) +PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
@ -20,7 +20,7 @@ index e767064..f18e7fa 100644
PKG_SOURCE_URL:=git://github.com/sbyx/odhcp6c.git PKG_SOURCE_URL:=git://github.com/sbyx/odhcp6c.git
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=357ecc1f5163bc7f74c64f4bca387e8d44a2eac5 -PKG_SOURCE_VERSION:=357ecc1f5163bc7f74c64f4bca387e8d44a2eac5
+PKG_SOURCE_VERSION:=6bbd2b0208fc17b6566595bfdfef2ff1d012d143 +PKG_SOURCE_VERSION:=26c5466e626735f27dd073b727b02612c5a807cd
PKG_MAINTAINER:=Steven Barth <steven@midlink.org> PKG_MAINTAINER:=Steven Barth <steven@midlink.org>
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
@ -29,6 +29,14 @@ index e767064..f18e7fa 100644
+ifneq ($(CONFIG_PACKAGE_odhcp6c_ext_prefix_class),0) +ifneq ($(CONFIG_PACKAGE_odhcp6c_ext_prefix_class),0)
+ CMAKE_OPTIONS += -DEXT_PREFIX_CLASS=$(CONFIG_PACKAGE_odhcp6c_ext_prefix_class) + CMAKE_OPTIONS += -DEXT_PREFIX_CLASS=$(CONFIG_PACKAGE_odhcp6c_ext_prefix_class)
+endif +endif
+
+ifneq ($(CONFIG_PACKAGE_odhcp6c_ext_cer_id),0)
+ CMAKE_OPTIONS += -DEXT_CER_ID=$(CONFIG_PACKAGE_odhcp6c_ext_cer_id)
+endif
+
+ifneq ($(CONFIG_PACKAGE_odhcp6c_ext_s46),0)
+ CMAKE_OPTIONS += -DEXT_S46=$(CONFIG_PACKAGE_odhcp6c_ext_s46)
+endif
+ +
define Package/odhcp6c define Package/odhcp6c
- SECTION:=ipv6 - SECTION:=ipv6
@ -44,16 +52,26 @@ index e767064..f18e7fa 100644
+ int "Prefix Class Extension ID (0 = disabled)" + int "Prefix Class Extension ID (0 = disabled)"
+ depends on PACKAGE_odhcp6c + depends on PACKAGE_odhcp6c
+ default 0 + default 0
+
+ config PACKAGE_odhcp6c_ext_cer_id
+ int "CER-ID Extension ID (0 = disabled)"
+ depends on PACKAGE_odhcp6c
+ default 0
+
+ config PACKAGE_odhcp6c_ext_s46
+ int "Softwire MAP Extension ID (0 = disabled)"
+ depends on PACKAGE_odhcp6c
+ default 0
+endef +endef
+ +
define Package/odhcp6c/install define Package/odhcp6c/install
$(INSTALL_DIR) $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/odhcp6c $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/odhcp6c $(1)/usr/sbin/
diff --git a/package/odhcp6c/files/dhcpv6.script b/package/odhcp6c/files/dhcpv6.script diff --git a/package/odhcp6c/files/dhcpv6.script b/package/odhcp6c/files/dhcpv6.script
index 324a823..d228014 100755 index 324a823..42c67c1 100755
--- a/package/odhcp6c/files/dhcpv6.script --- a/package/odhcp6c/files/dhcpv6.script
+++ b/package/odhcp6c/files/dhcpv6.script +++ b/package/odhcp6c/files/dhcpv6.script
@@ -64,23 +64,34 @@ setup_interface () { @@ -64,23 +64,63 @@ setup_interface () {
entry="${entry#*,}" entry="${entry#*,}"
local metric="${entry%%,*}" local metric="${entry%%,*}"
@ -71,6 +89,7 @@ index 324a823..d228014 100755
+ proto_add_data + proto_add_data
+ [ -n "$CER" ] && json_add_string cer "$CER" + [ -n "$CER" ] && json_add_string cer "$CER"
+ [ -n "$PASSTHRU" ] && json_add_string passthru "$PASSTHRU"
+ proto_close_data + proto_close_data
+ +
proto_send_update "$INTERFACE" proto_send_update "$INTERFACE"
@ -96,15 +115,43 @@ index 324a823..d228014 100755
+ [ -n "$ZONE_DSLITE" ] && json_add_string zone "$ZONE_DSLITE" + [ -n "$ZONE_DSLITE" ] && json_add_string zone "$ZONE_DSLITE"
+ [ -n "$IFACE_DSLITE_DELEGATE" ] && json_add_boolean delegate "$IFACE_DSLITE_DELEGATE" + [ -n "$IFACE_DSLITE_DELEGATE" ] && json_add_boolean delegate "$IFACE_DSLITE_DELEGATE"
+ json_close_object + json_close_object
+ ubus call network add_dynamic "$(json_dump)"
+ fi
+
+ MAPTYPE=""
+ MAPRULE=""
+
+ if [ -n "$MAPE" ]; then
+ MAPTYPE="map-e"
+ MAPRULE="$MAPE"
+ elif [ -n "$MAPT" ]; then
+ MAPTYPE="map-t"
+ MAPRULE="$MAPT"
+ elif [ -n "$LW4O6" ]; then
+ MAPTYPE="lw4o6"
+ MAPRULE="$LW4O6"
+ fi
+
+ if [ -n "$IFACE_MAP" -a -n "$MAPTYPE" -a -n "$MAPRULE" ]; then
+ json_init
+ json_add_string name "$IFACE_MAP"
+ json_add_string ifname "@$INTERFACE"
+ json_add_string proto map
+ json_add_string type "$MAPTYPE"
+ json_add_string rule "$MAPRULE"
+ json_add_string tunlink "$INTERFACE"
+ [ -n "$ZONE_MAP" ] && json_add_string zone "$ZONE_MAP"
+ [ -n "$IFACE_MAP_DELEGATE" ] && json_add_boolean delegate "$IFACE_MAP_DELEGATE"
+ json_close_object
+ ubus call network add_dynamic "$(json_dump)" + ubus call network add_dynamic "$(json_dump)"
fi fi
# TODO: $SNTP_IP $SIP_IP $SNTP_FQDN $SIP_DOMAIN # TODO: $SNTP_IP $SIP_IP $SNTP_FQDN $SIP_DOMAIN
diff --git a/package/odhcp6c/files/dhcpv6.sh b/package/odhcp6c/files/dhcpv6.sh diff --git a/package/odhcp6c/files/dhcpv6.sh b/package/odhcp6c/files/dhcpv6.sh
index bf6cd9a..90a8371 100755 index bf6cd9a..1c6d609 100755
--- a/package/odhcp6c/files/dhcpv6.sh --- a/package/odhcp6c/files/dhcpv6.sh
+++ b/package/odhcp6c/files/dhcpv6.sh +++ b/package/odhcp6c/files/dhcpv6.sh
@@ -5,23 +5,31 @@ @@ -5,23 +5,34 @@
init_proto "$@" init_proto "$@"
proto_dhcpv6_init_config() { proto_dhcpv6_init_config() {
@ -129,11 +176,14 @@ index bf6cd9a..90a8371 100755
+ proto_config_add_string 'ip6prefix:ip6addr' + proto_config_add_string 'ip6prefix:ip6addr'
+ proto_config_add_string iface_dslite + proto_config_add_string iface_dslite
+ proto_config_add_string zone_dslite + proto_config_add_string zone_dslite
+ proto_config_add_string iface_map
+ proto_config_add_string zone_map
+ proto_config_add_string 'ifaceid:ip6addr' + proto_config_add_string 'ifaceid:ip6addr'
+ proto_config_add_string 'sourcerouting:bool' + proto_config_add_string 'sourcerouting:bool'
+ proto_config_add_string "userclass" + proto_config_add_string "userclass"
+ proto_config_add_string "vendorclass" + proto_config_add_string "vendorclass"
+ proto_config_add_boolean delegate + proto_config_add_boolean delegate
+ proto_config_add_int "soltimeout"
} }
proto_dhcpv6_setup() { proto_dhcpv6_setup() {
@ -142,12 +192,12 @@ index bf6cd9a..90a8371 100755
- local reqaddress reqprefix clientid reqopts noslaaconly norelease ip6prefix iface_dslite ifaceid - local reqaddress reqprefix clientid reqopts noslaaconly norelease ip6prefix iface_dslite ifaceid
- json_get_vars reqaddress reqprefix clientid reqopts noslaaconly norelease ip6prefix iface_dslite ifaceid - json_get_vars reqaddress reqprefix clientid reqopts noslaaconly norelease ip6prefix iface_dslite ifaceid
+ local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite ifaceid sourcerouting userclass vendorclass delegate zone_dslite + local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map ifaceid sourcerouting userclass vendorclass delegate zone_dslite zone_map soltimeout
+ json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite ifaceid sourcerouting userclass vendorclass delegate zone_dslite + json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map ifaceid sourcerouting userclass vendorclass delegate zone_dslite zone_map soltimeout
# Configure # Configure
@@ -35,16 +43,25 @@ proto_dhcpv6_setup() { @@ -35,16 +46,30 @@ proto_dhcpv6_setup() {
[ "$noslaaconly" = "1" ] && append opts "-S" [ "$noslaaconly" = "1" ] && append opts "-S"
@ -165,15 +215,20 @@ index bf6cd9a..90a8371 100755
append opts "-r$opt" append opts "-r$opt"
done done
+ append opts "-t${soltimeout:-120}"
+
[ -n "$ip6prefix" ] && proto_export "USERPREFIX=$ip6prefix" [ -n "$ip6prefix" ] && proto_export "USERPREFIX=$ip6prefix"
[ -n "$iface_dslite" ] && proto_export "IFACE_DSLITE=$iface_dslite" [ -n "$iface_dslite" ] && proto_export "IFACE_DSLITE=$iface_dslite"
+ [ -n "$iface_map" ] && proto_export "IFACE_MAP=$iface_map"
+ [ "$sourcerouting" != "0" ] && proto_export "SOURCE_ROUTING=1" + [ "$sourcerouting" != "0" ] && proto_export "SOURCE_ROUTING=1"
+ [ "$delegate" = "0" ] && proto_export "IFACE_DSLITE_DELEGATE=0" + [ "$delegate" = "0" ] && proto_export "IFACE_DSLITE_DELEGATE=0"
+ [ "$delegate" = "0" ] && proto_export "IFACE_MAP_DELEGATE=0"
+ [ -n "$zone_dslite" ] && proto_export "ZONE_DSLITE=$zone_dslite" + [ -n "$zone_dslite" ] && proto_export "ZONE_DSLITE=$zone_dslite"
+ [ -n "$zone_map" ] && proto_export "ZONE_MAP=$zone_map"
proto_export "INTERFACE=$config" proto_export "INTERFACE=$config"
proto_run_command "$config" odhcp6c \ proto_run_command "$config" odhcp6c \
@@ -52,6 +69,13 @@ proto_dhcpv6_setup() { @@ -52,6 +77,13 @@ proto_dhcpv6_setup() {
$opts $iface $opts $iface
} }