summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-09-23 08:35:50 +0000
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2011-09-23 08:35:50 +0000
commit38fd142fbb02ebeb12adf32032a49e8d5cd6a17a (patch)
tree8f91c604ab3e5697f6de08236c0ba67e54f56435
parenta562bcf9d31180ce8f209cda71303dc2a0a35610 (diff)
[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
-rw-r--r--package/base-files/Makefile2
-rwxr-xr-xpackage/base-files/files/lib/network/config.sh4
2 files changed, 3 insertions, 3 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index bae3c79e2..775126aa5 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=base-files
-PKG_RELEASE:=79
+PKG_RELEASE:=80
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
PKG_BUILD_DEPENDS:=opkg/host
diff --git a/package/base-files/files/lib/network/config.sh b/package/base-files/files/lib/network/config.sh
index 5b349a738..00e372a1f 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
}