]> git.ipfire.org Git - people/ms/dnsmasq.git/commitdiff
Fix FTBFS when various facilities omitted at compile time.
authorSimon Kelley <simon@thekelleys.org.uk>
Mon, 23 Sep 2013 11:41:20 +0000 (12:41 +0100)
committerSimon Kelley <simon@thekelleys.org.uk>
Mon, 23 Sep 2013 11:41:20 +0000 (12:41 +0100)
src/lease.c
src/network.c
src/tftp.c

index 703337002579bf82aaa1e5d3eb9d2d310ff8afc0..02ca094d7fbcdcf6c198c26a193d03d5d9f28d2d 100644 (file)
@@ -462,7 +462,6 @@ void lease_update_dns(int force)
                      cache_add_dhcp_entry(lease->hostname, AF_INET6, (struct all_addr *)&slaac->addr, lease->expires);
                  }
            }
-#endif
          
          if (lease->fqdn)
            cache_add_dhcp_entry(lease->fqdn, prot, 
@@ -473,6 +472,14 @@ void lease_update_dns(int force)
            cache_add_dhcp_entry(lease->hostname, prot, 
                                 prot == AF_INET ? (struct all_addr *)&lease->addr : (struct all_addr *)&lease->addr6, 
                                 lease->expires);
+       
+#else
+         if (lease->fqdn)
+           cache_add_dhcp_entry(lease->fqdn, prot, (struct all_addr *)&lease->addr, lease->expires);
+         
+         if (!option_bool(OPT_DHCP_FQDN) && lease->hostname)
+           cache_add_dhcp_entry(lease->hostname, prot, (struct all_addr *)&lease->addr, lease->expires);
+#endif
        }
       
       dns_dirty = 0;
index 712d7ee7235e8f9ccc4c97201b69f3279b39faa9..576a7cf7cc25ff4acb54e6575acd77c30d2586b9 100644 (file)
@@ -243,7 +243,7 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
   int tftp_ok = !!option_bool(OPT_TFTP);
   int dhcp_ok = 1;
   int auth_dns = 0;
-#ifdef HAVE_DHCP
+#if defined(HAVE_DHCP) || defined(HAVE_TFTP)
   struct iname *tmp;
 #endif
 
@@ -362,6 +362,7 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
 #endif
  
   
+#ifdef HAVE_TFTP
   if (daemon->tftp_interfaces)
     {
       /* dedicated tftp interface list */
@@ -370,6 +371,7 @@ static int iface_allowed(struct iface_param *param, int if_index, char *label,
        if (tmp->name && wildcard_match(tmp->name, ifr.ifr_name))
          tftp_ok = 1;
     }
+#endif
   
   /* add to list */
   if ((iface = whine_malloc(sizeof(struct irec))))
index d611dea9df4dbeb46081cff9475b7ad83946e26a..d752e7125d00896b6c4a0785bc7081ed3cbb6f91 100644 (file)
@@ -49,9 +49,7 @@ void tftp_request(struct listener *listen, time_t now)
   struct iovec iov;
   struct ifreq ifr;
   int is_err = 1, if_index = 0, mtu = 0;
-#ifdef HAVE_DHCP
   struct iname *tmp;
-#endif
   struct tftp_transfer *transfer;
   int port = daemon->start_tftp_port; /* may be zero to use ephemeral port */
 #if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT)