[OpenWrt-Devel] [PATCH 2/2] dnsmasq: decouple /tmp/resolv.conf from value of option resolvfile

Hans Dedecker dedeckeh at gmail.com
Sun Feb 17 14:59:52 EST 2019


Hi Yousong,
On Thu, Feb 14, 2019 at 1:15 PM Yousong Zhou <yszhou4tech at gmail.com> wrote:Y
>
> Option resolvfile should now affect only how dnsmasq itself will run.
> The implicit effect of its specific value on other parts of the system
> makes the code unnecessarily hard to follow
>
> Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
> ---
>  package/network/services/dnsmasq/Makefile           | 2 +-
>  package/network/services/dnsmasq/files/dnsmasq.init | 7 +------
>  2 files changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
> index d51f23e48b..5e83b4f8e5 100644
> --- a/package/network/services/dnsmasq/Makefile
> +++ b/package/network/services/dnsmasq/Makefile
> @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
>
>  PKG_NAME:=dnsmasq
>  PKG_VERSION:=2.80
> -PKG_RELEASE:=8
> +PKG_RELEASE:=9
>
>  PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
>  PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
> diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
> index 05c555bd8c..22471c11aa 100644
> --- a/package/network/services/dnsmasq/files/dnsmasq.init
> +++ b/package/network/services/dnsmasq/files/dnsmasq.init
> @@ -888,7 +888,6 @@ dnsmasq_start()
>                 config_get resolvfile "$cfg" resolvfile
>                 [ -n "$resolvfile" -a ! -e "$resolvfile" ] && touch "$resolvfile"
>                 xappend "--resolv-file=$resolvfile"
> -               [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && localuse=1
By removing this line 127.0.0.1 is not added anymore in
/tmp/resolv.conf as localuse is 0 by default;
as a result local resolving is broken.

Hans
>         fi
>
>         config_get hostsfile "$cfg" dhcphostsfile
> @@ -1039,13 +1038,9 @@ dnsmasq_start()
>  dnsmasq_stop()
>  {
>         local cfg="$1"
> -       local noresolv resolvfile localuse
> +       local localuse
>
> -       config_get_bool noresolv "$cfg" noresolv 0
>         config_get_bool localuse "$cfg" localuse 0
> -       config_get resolvfile "$cfg" "resolvfile"
> -
> -       [ "$noresolv" = 0 -a "$resolvfile" = "/tmp/resolv.conf.auto" ] && localuse=1
>         [ "$localuse" -gt 0 ] && ln -sf "/tmp/resolv.conf.auto" /tmp/resolv.conf
>
>         rm -f ${BASEDHCPSTAMPFILE}.${cfg}.*.dhcp
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list