From d3682b53843a55dff63ee647f983037c5d44ed85 Mon Sep 17 00:00:00 2001
From: David Bauer <mail@david-bauer.net>
Date: Thu, 3 Aug 2023 00:44:59 +0200
Subject: [PATCH] gluon-wan-dnsmasq: use cellular DNS servers

Use DNS servers received from the cellular provider for the WAN dnsmasq
instance.

This fixes resolving VPN endpoint DNS requests when using only cellular
uplink.

Signed-off-by: David Bauer <mail@david-bauer.net>
---
 .../files/etc/hotplug.d/iface/50-gluon-wan-dnsmasq              | 2 +-
 .../lib/gluon/wan-dnsmasq/interface.d/050-gluon-wan-dnsmasq     | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/gluon-wan-dnsmasq/files/etc/hotplug.d/iface/50-gluon-wan-dnsmasq b/package/gluon-wan-dnsmasq/files/etc/hotplug.d/iface/50-gluon-wan-dnsmasq
index f43cbbb88..82b51dcfb 100644
--- a/package/gluon-wan-dnsmasq/files/etc/hotplug.d/iface/50-gluon-wan-dnsmasq
+++ b/package/gluon-wan-dnsmasq/files/etc/hotplug.d/iface/50-gluon-wan-dnsmasq
@@ -1,3 +1,3 @@
-if [ "$INTERFACE" = 'wan' -o "$INTERFACE" = 'wan6' ]; then
+if [ "$INTERFACE" = 'wan' -o "$INTERFACE" = 'wan6' -o "$INTERFACE" = 'cellular_4' -o "$INTERFACE" = 'cellular_6' ]; then
 	/lib/gluon/wan-dnsmasq/update.lua
 fi
diff --git a/package/gluon-wan-dnsmasq/files/lib/gluon/wan-dnsmasq/interface.d/050-gluon-wan-dnsmasq b/package/gluon-wan-dnsmasq/files/lib/gluon/wan-dnsmasq/interface.d/050-gluon-wan-dnsmasq
index 585dd7a96..6a5af835f 100644
--- a/package/gluon-wan-dnsmasq/files/lib/gluon/wan-dnsmasq/interface.d/050-gluon-wan-dnsmasq
+++ b/package/gluon-wan-dnsmasq/files/lib/gluon/wan-dnsmasq/interface.d/050-gluon-wan-dnsmasq
@@ -1,2 +1,4 @@
 wan6
 wan
+cellular_4
+cellular_6
-- 
GitLab