]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch
Update libvirt to 2.1
[ipfire-2.x.git] / src / patches / dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch
index f55ebe81e1485ba0cce65047705f1cc0dfd2a6f7..97b7749d4ca01ad3d050736bf97c39c50fbd85de 100644 (file)
@@ -19,7 +19,7 @@
  #ifdef HAVE_DNSSEC
    cache_blockdata_free(crecp);
  #endif
-@@ -1131,7 +1134,7 @@
+@@ -1138,7 +1141,7 @@
    
  } 
  
@@ -28,7 +28,7 @@
  struct in_addr a_record_from_hosts(char *name, time_t now)
  {
    struct crec *crecp = NULL;
-@@ -1274,7 +1277,11 @@
+@@ -1281,7 +1284,11 @@
        else
        crec->ttd = ttd;
        crec->addr.addr = *host_address;
@@ -42,7 +42,7 @@
  
 --- a/src/dnsmasq.c    Thu Jul 30 20:59:06 2015
 +++ b/src/dnsmasq.c    Wed Dec 16 19:38:32 2015
-@@ -982,6 +982,11 @@
+@@ -1017,6 +1017,11 @@
  
          poll_resolv(0, daemon->last_resolv != 0, now);          
          daemon->last_resolv = now;
@@ -56,7 +56,7 @@
  
 --- a/src/dnsmasq.h    Wed Dec 16 19:24:12 2015
 +++ b/src/dnsmasq.h    Wed Dec 16 19:40:11 2015
-@@ -1513,8 +1513,12 @@
+@@ -1516,6 +1516,11 @@
  void poll_listen(int fd, short event);
  int do_poll(int timeout);
  
@@ -72,7 +72,7 @@
 -
 --- /dev/null  Wed Dec 16 19:48:08 2015
 +++ b/src/isc.c        Wed Dec 16 19:41:35 2015
-@@ -0,0 +1,251 @@
+@@ -0,0 +1,266 @@
 +/* dnsmasq is Copyright (c) 2014 John Volpe, Simon Kelley and
 +     Michael Tremer
 +
 +  Michael Tremer.
 +*/
 +
++
++#define _GNU_SOURCE
++
++#include <assert.h>
++#include <stdio.h>
++
 +#include "dnsmasq.h"
 +
 +#ifdef HAVE_ISC_READER
 +
 +static struct isc_dhcp_lease* dhcp_lease_new(const char* hostname) {
 +      struct isc_dhcp_lease* lease = whine_malloc(sizeof(*lease));
++       if (!lease)
++               return NULL;
 +
 +      lease->name = strdup(hostname);
 +      if (daemon->domain_suffix) {
-+              asprintf(&lease->fqdn, "%s.%s", hostname, daemon->domain_suffix);
++               int r = asprintf(&lease->fqdn, "%s.%s", hostname, daemon->domain_suffix);
++
++               // Handle OOM
++               if (r < 0) {
++                       free(lease);
++                       return NULL;
++               }
 +      }
 +      lease->expires = 0;
 +      lease->next = NULL;
 +                                      // and append it to the list.
 +                                      if (!lease) {
 +                                              lease = dhcp_lease_new(hostname);
++                                              assert(lease);
 +
 +                                              lease->next = leases;
 +                                              leases = lease;
 +#endif
 --- a/src/option.c     Wed Dec 16 19:24:12 2015
 +++ b/src/option.c     Wed Dec 16 19:42:48 2015
-@@ -1754,7 +1754,7 @@
+@@ -1771,7 +1771,7 @@
        ret_err(_("bad MX target"));
        break;
  
         helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o \
         dhcp-common.o outpacket.o radv.o slaac.o auth.o ipset.o \
         domain.o dnssec.o blockdata.o tables.o loop.o inotify.o \
--       poll.o rrfilter.o
-+       poll.o rrfilter.o isc.o
+-       poll.o rrfilter.o edns0.o arp.o
++       poll.o rrfilter.o edns0.o arp.o isc.o
  
  hdrs = dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \
         dns-protocol.h radv-protocol.h ip6addr.h