From 9e8387f5bb27621a74f0699f0f191a63f7d46b17 Mon Sep 17 00:00:00 2001 From: Beginner <70857188+Beginner-Go@users.noreply.github.com> Date: Tue, 16 Nov 2021 16:19:06 +0800 Subject: [PATCH] dnsmasq: sync upstream (#8245) * dnsmasq: add ubus acl to allow calls to hotplug.tftp object dnsmasq may call hotplug.dhcp, hotplug.neigh and hotplug.tftp. Only the first two callees were listed in the ACL, so add missing hotplug.tftp. Signed-off-by: Daniel Golle * dnsmasq: fix the dynamic dns object names patch We can't use booleans, since we're not including stdbool.h. Use integers instead. Fixes: 0b79e7c01e ("dnsmasq: generate the dns object name dynamically") Signed-off-by: Rui Salvaterra Co-authored-by: Daniel Golle Co-authored-by: Rui Salvaterra --- .../services/dnsmasq/files/dnsmasq_acl.json | 3 +++ .../services/dnsmasq/patches/200-ubus_dns.patch | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/package/network/services/dnsmasq/files/dnsmasq_acl.json b/package/network/services/dnsmasq/files/dnsmasq_acl.json index 47d7c2930..67c6c2048 100644 --- a/package/network/services/dnsmasq/files/dnsmasq_acl.json +++ b/package/network/services/dnsmasq/files/dnsmasq_acl.json @@ -7,6 +7,9 @@ }, "hotplug.neigh": { "methods": [ "call" ] + }, + "hotplug.tftp": { + "methods": [ "call" ] } } } diff --git a/package/network/services/dnsmasq/patches/200-ubus_dns.patch b/package/network/services/dnsmasq/patches/200-ubus_dns.patch index 03fc5b50b..b8c4e4495 100644 --- a/package/network/services/dnsmasq/patches/200-ubus_dns.patch +++ b/package/network/services/dnsmasq/patches/200-ubus_dns.patch @@ -60,17 +60,17 @@ + *dest = blobmsg_get_string(val); +} + -+static bool ubus_dns_doctor(const char *name, int ttl, void *p, int af) ++static int ubus_dns_doctor(const char *name, int ttl, void *p, int af) +{ + struct blob_buf *b; + char *addr; + + if (!name) -+ return false; ++ return 0; + + b = ubus_dns_notify_prepare(); + if (!b) -+ return false; ++ return 0; + + blobmsg_add_string(b, "name", name); + @@ -80,7 +80,7 @@ + + addr = blobmsg_alloc_string_buffer(b, "address", INET6_ADDRSTRLEN); + if (!addr) -+ return false; ++ return 0; + + inet_ntop(af, p, addr, INET6_ADDRSTRLEN); + blobmsg_add_string_buffer(b); @@ -89,14 +89,14 @@ + ubus_dns_notify("dns_result", ubus_dns_doctor_cb, &addr); + + if (!addr) -+ return false; ++ return 0; + + return inet_pton(af, addr, p) == 1; +} +#else -+static bool ubus_dns_doctor(const char *name, int ttl, void *p, int af) ++static int ubus_dns_doctor(const char *name, int ttl, void *p, int af) +{ -+ return false; ++ return 0; +} +#endif +