aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/config/netifd/files
diff options
context:
space:
mode:
authorSteven Barth <cyrus@openwrt.org>2015-05-02 07:44:55 +0000
committerSteven Barth <cyrus@openwrt.org>2015-05-02 07:44:55 +0000
commita132313238ececf361992f319a27fea75e81e588 (patch)
treeaad7046fa1ae8e53c3d276a3abbe4e03ac0beea0 /package/network/config/netifd/files
parent498e3a7fd456cc4e39361a25cf8eead61f5742eb (diff)
downloadupstream-a132313238ececf361992f319a27fea75e81e588.tar.gz
upstream-a132313238ececf361992f319a27fea75e81e588.tar.bz2
upstream-a132313238ececf361992f319a27fea75e81e588.zip
dhcp: add option specifying overriding custom-routes
Signed-off-by: Steven Barth <steven@midlink.org> SVN-Revision: 45594
Diffstat (limited to 'package/network/config/netifd/files')
-rwxr-xr-xpackage/network/config/netifd/files/lib/netifd/dhcp.script4
-rwxr-xr-xpackage/network/config/netifd/files/lib/netifd/proto/dhcp.sh6
2 files changed, 8 insertions, 2 deletions
diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script b/package/network/config/netifd/files/lib/netifd/dhcp.script
index fb9f95a517..5b77f306f7 100755
--- a/package/network/config/netifd/files/lib/netifd/dhcp.script
+++ b/package/network/config/netifd/files/lib/netifd/dhcp.script
@@ -21,6 +21,10 @@ setup_interface () {
for i in $router; do
proto_add_ipv4_route "$i" 32 "" "$ip"
proto_add_ipv4_route 0.0.0.0 0 "$i" "$ip"
+
+ for r in $CUSTOMROUTES; do
+ proto_add_ipv4_route "${r%%/*}" "${r##*/}" "$i" "$ip"
+ done
done
# CIDR STATIC ROUTES (rfc3442)
diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
index d4c483d690..0e88af9e96 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -19,14 +19,15 @@ proto_dhcp_init_config() {
proto_config_add_string zone6rd
proto_config_add_string zone
proto_config_add_string mtu6rd
+ proto_config_add_string customroutes
}
proto_dhcp_setup() {
local config="$1"
local iface="$2"
- local ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd zone mtu6rd
- json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd zone mtu6rd
+ local ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes
+ json_get_vars ipaddr hostname clientid vendorid broadcast reqopts iface6rd sendopts delegate zone6rd zone mtu6rd customroutes
local opt dhcpopts
for opt in $reqopts; do
@@ -44,6 +45,7 @@ proto_dhcp_setup() {
[ -n "$zone6rd" ] && proto_export "ZONE6RD=$zone6rd"
[ -n "$zone" ] && proto_export "ZONE=$zone"
[ -n "$mtu6rd" ] && proto_export "MTU6RD=$mtu6rd"
+ [ -n "$customroutes" ] && proto_export "CUSTOMROUTES=$customroutes"
[ "$delegate" = "0" ] && proto_export "IFACE6RD_DELEGATE=0"
proto_export "INTERFACE=$config"