summaryrefslogtreecommitdiff
path: root/package/base-files/files
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-01-29 13:45:16 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-01-29 13:45:16 +0000
commita8edd9d50e47c438e6e56c993030aab0ef1aeeea (patch)
tree0a5f35254664475d6410518d00a06804396deb07 /package/base-files/files
parent001b9359deb1ca9d256d4488ed0d80e2f0fd3d1d (diff)
downloadmtk-20170518-a8edd9d50e47c438e6e56c993030aab0ef1aeeea.zip
mtk-20170518-a8edd9d50e47c438e6e56c993030aab0ef1aeeea.tar.gz
mtk-20170518-a8edd9d50e47c438e6e56c993030aab0ef1aeeea.tar.bz2
base-files: fix handling of dhcp "reqopts" option
SVN-Revision: 25237
Diffstat (limited to 'package/base-files/files')
-rwxr-xr-xpackage/base-files/files/lib/network/config.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/package/base-files/files/lib/network/config.sh b/package/base-files/files/lib/network/config.sh
index 449d252..b59b1f2 100755
--- a/package/base-files/files/lib/network/config.sh
+++ b/package/base-files/files/lib/network/config.sh
@@ -360,9 +360,14 @@ setup_interface() {
[ -z "$ipaddr" ] || \
$DEBUG ifconfig "$iface" "$ipaddr" ${netmask:+netmask "$netmask"}
+ # additional request options
+ local opt dhcpopts
+ for opt in $reqopts; do
+ append dhcpopts -O "$opt"
+ done
+
# don't stay running in background if dhcp is not the main proto on the interface (e.g. when using pptp)
- local dhcpopts
- [ ."$proto1" != ."$proto" ] && dhcpopts="-n -q"
+ [ "$proto1" != "$proto" ] && append dhcpopts "-n -q" || append dhcpopts "-O rootpath -R &"
[ "$broadcast" = 1 ] && broadcast="-O broadcast" || broadcast=
$DEBUG eval udhcpc -t 0 -i "$iface" \
@@ -371,8 +376,7 @@ setup_interface() {
${clientid:+-c $clientid} \
${vendorid:+-V $vendorid} \
-b -p "$pidfile" $broadcast \
- ${reqopts:+-O $reqopts} \
- ${dhcpopts:- -O rootpath -R &}
+ ${dhcpopts}
;;
none)
setup_interface_none "$iface" "$config"