dnsmasq: dns-hijack: read port from config

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen
2023-01-23 19:39:28 +08:00
parent 3d918ce54d
commit 09bbd88c46

View File

@@ -1222,7 +1222,7 @@ dnsmasq_start()
if [ "$dns_redirect" = 1 ]; then
nft add table inet dnsmasq
nft add chain inet dnsmasq prerouting "{ type nat hook prerouting priority -105; policy accept; }"
nft add rule inet dnsmasq prerouting "meta nfproto { ipv4, ipv6 } udp dport 53 counter redirect to :53 comment \"DNSMASQ HIJACK\""
nft add rule inet dnsmasq prerouting "meta nfproto { ipv4, ipv6 } udp dport 53 counter redirect to :$dns_port comment \"DNSMASQ HIJACK\""
fi
}