From 2313633cbd2aa0cb9a8705812184107b2d682036 Mon Sep 17 00:00:00 2001 From: Lienol <23146169+Lienol@users.noreply.github.com> Date: Fri, 5 Jul 2024 15:38:05 +0800 Subject: [PATCH] odhcp6c: Update to 2023-05-12 --- package/network/ipv6/odhcp6c/Makefile | 15 +++++++++++---- package/network/ipv6/odhcp6c/files/dhcpv6.script | 3 +++ package/network/ipv6/odhcp6c/files/dhcpv6.sh | 11 +++++++++-- package/network/ipv6/odhcp6c/files/odhcp6c.user | 1 + 4 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 package/network/ipv6/odhcp6c/files/odhcp6c.user diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile index c9eaaedb19..ac507e1f17 100644 --- a/package/network/ipv6/odhcp6c/Makefile +++ b/package/network/ipv6/odhcp6c/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcp6c -PKG_RELEASE:=16 +PKG_RELEASE:=20 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git -PKG_SOURCE_DATE:=2021-01-09 -PKG_SOURCE_VERSION:=53f07e90b7f1da6977143a488dd5cb73a33b233b -PKG_MIRROR_HASH:=ad3665b611d19177996771b11df28d92f066b0125484ea3bdfc0b3185c14f90e +PKG_SOURCE_DATE:=2023-05-12 +PKG_SOURCE_VERSION:=bcd283632ac13391aac3ebdd074d1fd832d76fa3 +PKG_MIRROR_HASH:=0f3508a5a148ca831ae30b49b21919535f9dfbbd003a942baa6cb5388d207878 PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 @@ -42,12 +42,19 @@ define Package/odhcp6c/config default 0 endef +define Package/odhcp6c/conffiles +/etc/odhcp6c.user +/etc/odhcp6c.user.d/ +endef + define Package/odhcp6c/install $(INSTALL_DIR) $(1)/usr/sbin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/odhcp6c $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/lib/netifd/proto $(INSTALL_BIN) ./files/dhcpv6.sh $(1)/lib/netifd/proto/dhcpv6.sh $(INSTALL_BIN) ./files/dhcpv6.script $(1)/lib/netifd/ + $(INSTALL_DIR) $(1)/etc/odhcp6c.user.d/ + $(INSTALL_CONF) ./files/odhcp6c.user $(1)/etc/ endef $(eval $(call BuildPackage,odhcp6c)) diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script index 28955a358f..b1a99ed986 100755 --- a/package/network/ipv6/odhcp6c/files/dhcpv6.script +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script @@ -237,5 +237,8 @@ esac # user rules [ -f /etc/odhcp6c.user ] && . /etc/odhcp6c.user "$@" +for f in /etc/odhcp6c.user.d/*; do + [ -f "$f" ] && (. "$f" "$@") +done exit 0 diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh index cf6847f29e..18c24febd6 100755 --- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh @@ -34,11 +34,13 @@ proto_dhcpv6_init_config() { proto_config_add_string "vendorclass" proto_config_add_array "sendopts:list(string)" proto_config_add_boolean delegate + proto_config_add_int skpriority proto_config_add_int "soltimeout" proto_config_add_boolean fakeroutes proto_config_add_boolean sourcefilter proto_config_add_boolean keep_ra_dnslifetime proto_config_add_int "ra_holdoff" + proto_config_add_boolean verbose } proto_dhcpv6_add_prefix() { @@ -53,8 +55,8 @@ proto_dhcpv6_setup() { local config="$1" local iface="$2" - local reqaddress reqprefix clientid reqopts defaultreqopts noslaaconly forceprefix extendprefix norelease noserverunicast noclientfqdn noacceptreconfig ip6prefix ip6prefixes iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass sendopts delegate zone_dslite zone_map zone_464xlat zone encaplimit_dslite encaplimit_map soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff - json_get_vars reqaddress reqprefix clientid reqopts defaultreqopts noslaaconly forceprefix extendprefix norelease noserverunicast noclientfqdn noacceptreconfig iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone encaplimit_dslite encaplimit_map soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff + local reqaddress reqprefix clientid reqopts defaultreqopts noslaaconly forceprefix extendprefix norelease noserverunicast noclientfqdn noacceptreconfig ip6prefix ip6prefixes iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass sendopts delegate zone_dslite zone_map zone_464xlat zone encaplimit_dslite encaplimit_map skpriority soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff verbose + json_get_vars reqaddress reqprefix clientid reqopts defaultreqopts noslaaconly forceprefix extendprefix norelease noserverunicast noclientfqdn noacceptreconfig iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone encaplimit_dslite encaplimit_map skpriority soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff verbose json_for_each_item proto_dhcpv6_add_prefix ip6prefix ip6prefixes # Configure @@ -88,8 +90,12 @@ proto_dhcpv6_setup() { [ "$keep_ra_dnslifetime" = "1" ] && append opts "-L" + [ -n "$skpriority" ] && append opts "-K$skpriority" + [ -n "$ra_holdoff" ] && append opts "-m$ra_holdoff" + [ "$verbose" = "1" ] && append opts "-v" + local opt for opt in $reqopts; do append opts "-r$opt" @@ -105,6 +111,7 @@ proto_dhcpv6_setup() { [ -n "$iface_464xlat" ] && proto_export "IFACE_464XLAT=$iface_464xlat" [ "$delegate" = "0" ] && proto_export "IFACE_DSLITE_DELEGATE=0" [ "$delegate" = "0" ] && proto_export "IFACE_MAP_DELEGATE=0" + [ "$delegate" = "0" ] && proto_export "IFACE_464XLAT_DELEGATE=0" [ -n "$zone_dslite" ] && proto_export "ZONE_DSLITE=$zone_dslite" [ -n "$zone_map" ] && proto_export "ZONE_MAP=$zone_map" [ -n "$zone_464xlat" ] && proto_export "ZONE_464XLAT=$zone_464xlat" diff --git a/package/network/ipv6/odhcp6c/files/odhcp6c.user b/package/network/ipv6/odhcp6c/files/odhcp6c.user new file mode 100644 index 0000000000..f15a1b1761 --- /dev/null +++ b/package/network/ipv6/odhcp6c/files/odhcp6c.user @@ -0,0 +1 @@ +# This script is sourced by odhcp6c's dhcpv6.script at every DHCPv6 event.