aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/network
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2011-09-23 08:35:50 +0000
committerJo-Philipp Wich <jow@openwrt.org>2011-09-23 08:35:50 +0000
commitecf06687c7ba88e4f9a5427c34eab7d7a9531e66 (patch)
tree8f91c604ab3e5697f6de08236c0ba67e54f56435 /package/base-files/files/lib/network
parent3e8a8a03a2e0b989293b49bb214bcfbf8632341f (diff)
downloadmaster-187ad058-ecf06687c7ba88e4f9a5427c34eab7d7a9531e66.tar.gz
master-187ad058-ecf06687c7ba88e4f9a5427c34eab7d7a9531e66.tar.bz2
master-187ad058-ecf06687c7ba88e4f9a5427c34eab7d7a9531e66.zip
[package] base-files: make ip matching in dns add/remove functions more explicit, avoids overmatching pairs like 1.2.3.35 and 1.2.3.3
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@28291 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/lib/network')
-rwxr-xr-xpackage/base-files/files/lib/network/config.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/package/base-files/files/lib/network/config.sh b/package/base-files/files/lib/network/config.sh
index 5b349a7387..00e372a1f3 100755
--- a/package/base-files/files/lib/network/config.sh
+++ b/package/base-files/files/lib/network/config.sh
@@ -106,7 +106,7 @@ add_dns() {
local dns
local add
for dns in "$@"; do
- grep -qsF "nameserver $dns" /tmp/resolv.conf.auto || {
+ grep -qsE "^nameserver ${dns//./\\.}$" /tmp/resolv.conf.auto || {
add="${add:+$add }$dns"
echo "nameserver $dns" >> /tmp/resolv.conf.auto
}
@@ -126,7 +126,7 @@ remove_dns() {
[ -f /tmp/resolv.conf.auto ] && {
local dns=$(uci_get_state network "$cfg" resolv_dns)
for dns in $dns; do
- sed -i -e "/^nameserver $dns$/d" /tmp/resolv.conf.auto
+ sed -i -e "/^nameserver ${dns//./\\.}$/d" /tmp/resolv.conf.auto
done
}