pppd: set resolv.conf directory appropiately
authorGustavo Zacarias <gustavo@zacarias.com.ar>
Mon, 20 Oct 2014 21:32:32 +0000 (18:32 -0300)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 29 Oct 2014 22:25:38 +0000 (23:25 +0100)
/etc/ppp/resolv.conf might not be writable and it's not useful, switch
to standard /etc/resolv.conf
If users don't want to update dns lookup entries they shouldn't use the
"userpeerdns" option.

[Thomas: slightly reword the comment in the code.]

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/pppd/pppd.mk

index eb06eec40175c6c5d1945753cb4a40b28967063a..0a88251468014eaea8558b999f6cd786795701b0 100644 (file)
@@ -35,6 +35,15 @@ endef
 
 PPPD_POST_EXTRACT_HOOKS += PPPD_DROP_INTERNAL_IF_PPOL2TP_H
 
+# pppd defaults to /etc/ppp/resolv.conf, which not be writable and is
+# definitely not useful since the C library only uses
+# /etc/resolv.conf. Therefore, we change pppd to use /etc/resolv.conf
+# instead.
+define PPPD_SET_RESOLV_CONF
+       $(SED) 's,ppp/resolv.conf,resolv.conf,' $(@D)/pppd/pathnames.h
+endef
+PPPD_POST_EXTRACT_HOOKS += PPPD_SET_RESOLV_CONF
+
 define PPPD_CONFIGURE_CMDS
        $(SED) 's/FILTER=y/#FILTER=y/' $(PPPD_DIR)/pppd/Makefile.linux
        $(SED) 's/ifneq ($$(wildcard \/usr\/include\/pcap-bpf.h),)/ifdef FILTER/' $(PPPD_DIR)/*/Makefile.linux