[LEDE-DEV] [PATCH v3] dnsmaq: add interface to ubus notification

Borja Salazar borja.salazar at fon.com
Wed Nov 29 02:26:58 PST 2017


Signed-off-by: Borja Salazar <borja.salazar at fon.com>
---
 package/network/services/dnsmasq/Makefile               |  2 +-
 package/network/services/dnsmasq/patches/240-ubus.patch | 12 +++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index ad118c6626..2c1073c148 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.78
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/
diff --git a/package/network/services/dnsmasq/patches/240-ubus.patch b/package/network/services/dnsmasq/patches/240-ubus.patch
index 0e0b1dd1b0..0a380ca824 100644
--- a/package/network/services/dnsmasq/patches/240-ubus.patch
+++ b/package/network/services/dnsmasq/patches/240-ubus.patch
@@ -9,7 +9,7 @@
  struct daemon *daemon;
  
  static volatile pid_t pid = 0;
-@@ -32,6 +34,62 @@ static void fatal_event(struct event_des
+@@ -32,6 +34,64 @@ static void fatal_event(struct event_des
  static int read_event(int fd, struct event_desc *evp, char **msg);
  static void poll_resolv(int force, int do_reload, time_t now);
  
@@ -25,7 +25,7 @@
 +	.type = &ubus_object_type,
 +};
 +
-+void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name)
++void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name, const char *interface)
 +{
 +	if (!ubus || !ubus_object.has_subscribers)
 +		return;
@@ -37,6 +37,8 @@
 +		blobmsg_add_string(&b, "ip", ip);
 +	if (name)
 +		blobmsg_add_string(&b, "name", name);
++	if (interface)
++		blobmsg_add_string(&b, "interface", interface);
 +	ubus_notify(ubus, &ubus_object, type, b.head, -1);
 +}
 +
@@ -106,7 +108,7 @@
  #  endif
  #endif
  
-+void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name);
++void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name, const char *interface);
 +
  /* ipset.c */
  #ifdef HAVE_IPSET
@@ -118,9 +120,9 @@
  	      string ? string : "",
  	      err ? err : "");
 +  if (!strcmp(type, "DHCPACK"))
-+	  ubus_event_bcast("dhcp.ack", daemon->namebuff, addr ? inet_ntoa(a) : NULL, string ? string : NULL);
++	  ubus_event_bcast("dhcp.ack", daemon->namebuff, addr ? inet_ntoa(a) : NULL, string ? string : NULL, interface);
 +  else if (!strcmp(type, "DHCPRELEASE"))
-+	  ubus_event_bcast("dhcp.release", daemon->namebuff, addr ? inet_ntoa(a) : NULL, string ? string : NULL);
++	  ubus_event_bcast("dhcp.release", daemon->namebuff, addr ? inet_ntoa(a) : NULL, string ? string : NULL, interface);
  }
  
  static void log_options(unsigned char *start, u32 xid)
-- 
2.11.0




More information about the Lede-dev mailing list