Topic: Reload DNS settings for established DHCP connections

We found out, if chillispot receives the signal SIGHUP, the settings are reloaded but not written to the established DHCP connections.

So only new clients receive new DNS settungs but the established ones dosen't.
Here is a little patch to fix this behavior (http://bitswitcher.sourceforge.net/misc … ngup.patch):

--- chillispot-1.1.0_orig/src/chilli.c    2006-09-24 19:48:25.000000000 +0200
+++ chillispot-1.1.0_new/src/chilli.c    2008-05-14 15:35:50.000000000 +0200
@@ -1081,6 +1081,21 @@
   return 0;
 }
 
+//dirty fix to set dns_settings to all dhcp connections
+//by Michael Finsterbusch <fibu@users.sourceforge.net>, Patrick Schmidt <coolman1982@users.sourceforge.net>
+void static dhcp_reload_dns_on_hangup(struct dhcp_t *dhcp,struct options_t options)
+{
+  struct dhcp_conn_t *conn;
+  struct dhcp_conn_t temp;
+  conn=dhcp->firstusedconn;
+  while(conn)
+  {
+    memcpy((void*)&temp,(void*)conn,sizeof(struct dhcp_conn_t));
+    dhcp_set_addrs(conn, &temp.hisip, &options.mask, &temp.ourip, &options.dns1, &options.dns2, options.domain);
+    conn=conn->next;
+  }
+}
+
 void static reprocess_options(int argc, char **argv) {
   struct options_t options2;
   sys_err(LOG_INFO, __FILE__, __LINE__, 0,
@@ -1121,12 +1136,18 @@
   options.eapolenable = options2.eapolenable; /* eapolenable */
   options.pidfile = options2.pidfile; /* pidfile */
 
+
   /* Reinit DHCP parameters */
+  
+
   (void) dhcp_set(dhcp, (options.debug & DEBUG_DHCP),
           options.uamserver, options.uamserverlen, options.uamanydns,
           options.uamokip, options.uamokiplen,
           options.uamokaddr, options.uamokmask, options.uamoknetlen);
-  
+
+  //PATCH, reload dns_settings on all clients
+  (void) dhcp_reload_dns_on_hangup(dhcp,options);
+
   /* Reinit RADIUS parameters */
   (void) radius_set(radius, (options.debug & DEBUG_RADIUS),
             &options.radiusserver1, &options.radiusserver2,