odhcp6c: allow setting a user-provided prefix as well

SVN-Revision: 35570
This commit is contained in:
Steven Barth 2013-02-12 08:23:54 +00:00
parent eeaf2c0b5a
commit 99b69fd9c5
3 changed files with 7 additions and 3 deletions

View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=odhcp6c PKG_NAME:=odhcp6c
PKG_VERSION:=2013-02-11 PKG_VERSION:=2013-02-12
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

View File

@ -28,6 +28,8 @@ setup_interface () {
proto_add_ipv6_prefix "$prefix" proto_add_ipv6_prefix "$prefix"
done done
[ -n "$USERPREFIX" ] && proto_add_ipv6_prefix "$USERPREFIX"
# Merge addresses # Merge addresses
for entry in $RA_ADDRESSES; do for entry in $RA_ADDRESSES; do
local duplicate=0 local duplicate=0

View File

@ -10,14 +10,15 @@ proto_dhcpv6_init_config() {
proto_config_add_string "clientid" proto_config_add_string "clientid"
proto_config_add_string "reqopts" proto_config_add_string "reqopts"
proto_config_add_string "noslaaconly" proto_config_add_string "noslaaconly"
proto_config_add_string "ip6prefix"
} }
proto_dhcpv6_setup() { proto_dhcpv6_setup() {
local config="$1" local config="$1"
local iface="$2" local iface="$2"
local reqaddress reqprefix clientid reqopts noslaaconly local reqaddress reqprefix clientid reqopts noslaaconly ip6prefix
json_get_vars reqaddress reqprefix clientid reqopts noslaaconly json_get_vars reqaddress reqprefix clientid reqopts noslaaconly ip6prefix
# Configure # Configure
@ -35,6 +36,7 @@ proto_dhcpv6_setup() {
append opts "-r$opt" append opts "-r$opt"
done done
[ -n "$ip6prefix" ] && proto_export "USERPREFIX=$ip6prefix"
proto_export "INTERFACE=$config" proto_export "INTERFACE=$config"
proto_run_command "$config" odhcp6c \ proto_run_command "$config" odhcp6c \