summaryrefslogtreecommitdiff
path: root/package/base-files/files/lib
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-06-09 12:25:48 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-06-09 12:25:48 +0000
commitfd8ec241877a19ea3ee8842f274e8e1d6454186d (patch)
treeed081df3603a66a2f8ad4444413e542245e3eaa3 /package/base-files/files/lib
parente3e2a170cd3f3254a82af0c43f91ad1281a8cac4 (diff)
downloadmtk-20170518-fd8ec241877a19ea3ee8842f274e8e1d6454186d.zip
mtk-20170518-fd8ec241877a19ea3ee8842f274e8e1d6454186d.tar.gz
mtk-20170518-fd8ec241877a19ea3ee8842f274e8e1d6454186d.tar.bz2
base-files: if an ip6addr without a prefix is given, assume /128 - otherwise the busybox utilities will interpret it as /0 and create an invalid default route
SVN-Revision: 27145
Diffstat (limited to 'package/base-files/files/lib')
-rwxr-xr-xpackage/base-files/files/lib/network/config.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/package/base-files/files/lib/network/config.sh b/package/base-files/files/lib/network/config.sh
index 7e4a53d..76ba324 100755
--- a/package/base-files/files/lib/network/config.sh
+++ b/package/base-files/files/lib/network/config.sh
@@ -235,6 +235,11 @@ setup_interface_static() {
config_get bcast "$config" broadcast
config_get metric "$config" metric
+ case "$ip6addr" in
+ */*) ;;
+ *:*) ip6addr="$ip6addr/128" ;;
+ esac
+
[ -z "$ipaddr" ] || $DEBUG ifconfig "$iface" "$ipaddr" netmask "$netmask" broadcast "${bcast:-+}"
[ -z "$ip6addr" ] || $DEBUG ifconfig "$iface" add "$ip6addr"
[ -z "$gateway" ] || $DEBUG route add default gw "$gateway" ${metric:+metric $metric} dev "$iface"