why the complication of a static string rather than a define? gcc isn't dumb
authorRuss Dill <Russ.Dill@asu.edu>
Tue, 16 Dec 2003 02:30:53 +0000 (02:30 -0000)
committerRuss Dill <Russ.Dill@asu.edu>
Tue, 16 Dec 2003 02:30:53 +0000 (02:30 -0000)
networking/udhcp/dhcpd.h
networking/udhcp/dumpleases.c
networking/udhcp/files.c

index e219143cc3f84d1778e93c510c5de669cb90710f..d53a809cac22a28af57179b8119d596e49f5c61e 100644 (file)
@@ -5,7 +5,9 @@
 #include <netinet/ip.h>
 #include <netinet/udp.h>
 
+#include "libbb_udhcp.h"
 #include "leases.h"
+#include "version.h"
 
 /************************************/
 /* Defaults _you_ may want to tweak */
@@ -13,6 +15,7 @@
 
 /* the period of time the client is allowed to use that address */
 #define LEASE_TIME              (60*60*24*10) /* 10 days of seconds */
+#define LEASES_FILE            "/var/lib/misc/udhcpd.leases"
 
 /* where to find the DHCP server configuration file */
 #define DHCPD_CONF_FILE         "/etc/udhcpd.conf"
index 5cb3a156fdbca34c47af64bf1d7f95d3e6134922..4c1ee131f01ffb9910705d3a7f4822e38996e6f5 100644 (file)
@@ -43,7 +43,7 @@ int main(int argc, char *argv[])
        FILE *fp;
        int i, c, mode = REMAINING;
        long expires;
-       const char *file = leases_file;
+       const char *file = LEASES_FILE;
        struct dhcpOfferedAddr lease;
        struct in_addr addr;
        
index 0597dc310e9604f99433a3be11fe173f524be5b4..23d8c00944cb3bb7f893e6fa0226d78c483676b1 100644 (file)
@@ -167,7 +167,7 @@ static const struct config_keyword keywords[] = {
        {"conflict_time",read_u32,&(server_config.conflict_time),"3600"},
        {"offer_time",  read_u32, &(server_config.offer_time),  "60"},
        {"min_lease",   read_u32, &(server_config.min_lease),   "60"},
-       {"lease_file",  read_str, &(server_config.lease_file),  leases_file},
+       {"lease_file",  read_str, &(server_config.lease_file),  LEASES_FILE},
        {"pidfile",     read_str, &(server_config.pidfile),     "/var/run/udhcpd.pid"},
        {"notify_file", read_str, &(server_config.notify_file), ""},
        {"siaddr",      read_ip,  &(server_config.siaddr),      "0.0.0.0"},