From: Evan Hunt Date: Sat, 27 Oct 2007 19:15:37 +0000 (+0000) Subject: Use different paths for PID and lease files when running in DHCPv4 or X-Git-Tag: v4_0_0b3~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=75135a3f7f86854a13de4fdf4a3b87eded2bcf2f;p=thirdparty%2Fdhcp.git Use different paths for PID and lease files when running in DHCPv4 or DHCPv6 mode, so that servers for both protcols can be run simultaneously on a single interface. [rt17227] --- diff --git a/RELNOTES b/RELNOTES index fc97c2dd4..cc64dfdda 100644 --- a/RELNOTES +++ b/RELNOTES @@ -54,6 +54,10 @@ suggested fixes to . Changes since 4.0.0b1 +- Use different paths for PID and lease files when running in DHCPv4 + or DHCPv6 mode, so that servers for both protcols can be run + simultaneously on a single interface. + - Fixed a buffer overflow error which could have allowed a denial of service under unusual server configurations diff --git a/dst/dst_support.c b/dst/dst_support.c index c2f4997f9..2b1008d9e 100644 --- a/dst/dst_support.c +++ b/dst/dst_support.c @@ -1,4 +1,4 @@ -static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/dst_support.c,v 1.1 2001/02/22 07:22:08 mellon Exp $"; +static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/dst_support.c,v 1.2 2007/10/27 19:15:32 each Exp $"; /* @@ -155,7 +155,7 @@ dst_s_conv_bignum_b64_to_u8(const char **buf, } bp = strchr(*buf, '\n'); /* find length of input line */ if (bp != NULL) - *bp = (u_char) NULL; + *bp = '\0'; blen = b64_pton(*buf, bstr, sizeof(bstr)); if (blen <= 0) { diff --git a/includes/cf/aix.h b/includes/cf/aix.h index 21a7c720a..2690e5adf 100644 --- a/includes/cf/aix.h +++ b/includes/cf/aix.h @@ -64,6 +64,9 @@ extern int h_errno; #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/etc/dhcpd.pid" #endif +#ifndef _PATH_DHCPD6_PID +#define _PATH_DHCPD6_PID "/etc/dhcpd6.pid" +#endif #ifndef _PATH_DHCLIENT_PID #define _PATH_DHCLIENT_PID "/etc/dhclient.pid" #endif diff --git a/includes/cf/alphaosf.h b/includes/cf/alphaosf.h index 38ad33a8b..f8815d90b 100644 --- a/includes/cf/alphaosf.h +++ b/includes/cf/alphaosf.h @@ -80,6 +80,9 @@ typedef unsigned long u_int64_t; #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/var/run/dhcpd.pid" #endif +#ifndef _PATH_DHCPD6_PID +#define _PATH_DHCPD6_PID "/var/run/dhcpd6.pid" +#endif #ifndef _PATH_DHCLIENT_PID #define _PATH_DHCLIENT_PID "/var/run/dhclient.pid" #endif diff --git a/includes/cf/bsdos.h b/includes/cf/bsdos.h index 15654306c..18692e3aa 100644 --- a/includes/cf/bsdos.h +++ b/includes/cf/bsdos.h @@ -60,9 +60,15 @@ extern int h_errno; #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/var/run/dhcpd.pid" #endif +#ifndef _PATH_DHCPD6_PID +#define _PATH_DHCPD6_PID "/var/run/dhcpd6.pid" +#endif #ifndef _PATH_DHCPD_DB #define _PATH_DHCPD_DB "/var/db/dhcpd.leases" #endif +#ifndef _PATH_DHCPD6_DB +#define _PATH_DHCPD6_DB "/var/db/dhcpd6.leases" +#endif #ifndef _PATH_DHCLIENT_PID #define _PATH_DHCLIENT_PID "/var/run/dhclient.pid" #endif diff --git a/includes/cf/cygwin32.h b/includes/cf/cygwin32.h index 78119ad35..c6c2b4e6e 100644 --- a/includes/cf/cygwin32.h +++ b/includes/cf/cygwin32.h @@ -75,9 +75,15 @@ #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "//e/etc/dhcpd.pid" #endif +#ifndef _PATH_DHCPD6_PID +#define _PATH_DHCPD6_PID "//e/etc/dhcpd6.pid" +#endif #ifndef _PATH_DHCPD_DB #define _PATH_DHCPD_DB "//e/etc/dhcpd.leases" #endif +#ifndef _PATH_DHCPD6_DB +#define _PATH_DHCPD6_DB "//e/etc/dhcpd6.leases" +#endif #ifndef _PATH_DHCPD_CONF #define _PATH_DHCPD_CONF "//e/etc/dhcpd.conf" #endif diff --git a/includes/cf/freebsd.h b/includes/cf/freebsd.h index 5bb009086..ffe8b03e8 100644 --- a/includes/cf/freebsd.h +++ b/includes/cf/freebsd.h @@ -67,9 +67,15 @@ extern int h_errno; #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/var/run/dhcpd.pid" #endif +#ifndef _PATH_DHCPD6_PID +#define _PATH_DHCPD6_PID "/var/run/dhcpd6.pid" +#endif #ifndef _PATH_DHCPD_DB #define _PATH_DHCPD_DB "/var/db/dhcpd.leases" #endif +#ifndef _PATH_DHCPD6_DB +#define _PATH_DHCPD6_DB "/var/db/dhcpd6.leases" +#endif #ifndef _PATH_DHCLIENT_PID #define _PATH_DHCLIENT_PID "/var/run/dhclient.pid" #endif diff --git a/includes/cf/hpux.h b/includes/cf/hpux.h index dc6e17837..62271f682 100644 --- a/includes/cf/hpux.h +++ b/includes/cf/hpux.h @@ -62,6 +62,9 @@ extern int h_errno; #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/etc/dhcpd.pid" #endif +#ifndef _PATH_DHCPD6_PID +#define _PATH_DHCPD6_PID "/etc/dhcpd6.pid" +#endif #ifndef _PATH_DHCLIENT_PID #define _PATH_DHCLIENT_PID "/etc/dhclient.pid" #endif diff --git a/includes/cf/irix.h b/includes/cf/irix.h index 7dbaa7eff..b5321ee6e 100644 --- a/includes/cf/irix.h +++ b/includes/cf/irix.h @@ -50,11 +50,19 @@ extern int h_errno; #include #define _PATH_DHCPD_CONF "/usr/local/etc/dhcpd.conf" -#define _PATH_DHCPD_DB "/usr/local/etc/dhcp/dhcpd.leases" +#ifndef _PATH_DHCPD_DB +#define _PATH_DHCPD_DB "/usr/local/etc/dhcp/dhcpd.leases" +#endif +#ifndef _PATH_DHCPD6_DB +#define _PATH_DHCPD6_DB "/usr/local/etc/dhcp/dhcpd6.leases" +#endif #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/etc/dhcpd.pid" #endif +#ifndef _PATH_DHCPD6_PID +#define _PATH_DHCPD6_PID "/etc/dhcpd6.pid" +#endif #ifndef _PATH_DHCLIENT_PID #define _PATH_DHCLIENT_PID "/etc/dhclient.pid" #endif diff --git a/includes/cf/linux.h b/includes/cf/linux.h index 09aa7e3d0..d37873fca 100644 --- a/includes/cf/linux.h +++ b/includes/cf/linux.h @@ -85,6 +85,9 @@ extern int h_errno; #ifndef _PATH_DHCPD_DB #define _PATH_DHCPD_DB "/var/state/dhcp/dhcpd.leases" #endif +#ifndef _PATH_DHCPD6_DB +#define _PATH_DHCPD6_DB "/var/state/dhcp/dhcpd6.leases" +#endif #ifndef _PATH_DHCLIENT_DB #define _PATH_DHCLIENT_DB "/var/state/dhcp/dhclient.leases" diff --git a/includes/cf/netbsd.h b/includes/cf/netbsd.h index 883e1b9a5..df892d027 100644 --- a/includes/cf/netbsd.h +++ b/includes/cf/netbsd.h @@ -63,9 +63,15 @@ extern int h_errno; #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/var/run/dhcpd.pid" #endif +#ifndef _PATH_DHCPD6_PID +#define _PATH_DHCPD6_PID "/var/run/dhcpd6.pid" +#endif #ifndef _PATH_DHCPD_DB #define _PATH_DHCPD_DB "/var/db/dhcpd.leases" #endif +#ifndef _PATH_DHCPD6_DB +#define _PATH_DHCPD6_DB "/var/db/dhcpd6.leases" +#endif #ifndef _PATH_DHCLIENT_PID #define _PATH_DHCLIENT_PID "/var/run/dhclient.pid" #endif diff --git a/includes/cf/nextstep.h b/includes/cf/nextstep.h index d39e01151..b13525c36 100644 --- a/includes/cf/nextstep.h +++ b/includes/cf/nextstep.h @@ -75,6 +75,10 @@ extern int h_errno; # define _PATH_DHCPD_PID "/etc/dhcpd.pid" #endif +#if !defined (_PATH_DHCPD6_PID) +# define _PATH_DHCPD6_PID "/etc/dhcpd6.pid" +#endif + #if !defined (_PATH_DHCLIENT_PID) # define _PATH_DHCLIENT_PID "/etc/dhclient.pid" #endif diff --git a/includes/cf/openbsd.h b/includes/cf/openbsd.h index ce9b5b87e..f14177cdc 100644 --- a/includes/cf/openbsd.h +++ b/includes/cf/openbsd.h @@ -63,9 +63,15 @@ extern int h_errno; #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/var/run/dhcpd.pid" #endif +#ifndef _PATH_DHCPD6_PID +#define _PATH_DHCPD6_PID "/var/run/dhcpd6.pid" +#endif #ifndef _PATH_DHCPD_DB #define _PATH_DHCPD_DB "/var/db/dhcpd.leases" #endif +#ifndef _PATH_DHCPD6_DB +#define _PATH_DHCPD6_DB "/var/db/dhcpd6.leases" +#endif #ifndef _PATH_DHCLIENT_PID #define _PATH_DHCLIENT_PID "/var/run/dhclient.pid" #endif diff --git a/includes/cf/qnx.h b/includes/cf/qnx.h index acde1d905..f2ad027c3 100644 --- a/includes/cf/qnx.h +++ b/includes/cf/qnx.h @@ -66,6 +66,9 @@ extern int h_errno; #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/etc/dhcpd.pid" #endif +#ifndef _PATH_DHCPD6_PID +#define _PATH_DHCPD6_PID "/etc/dhcpd6.pid" +#endif #ifndef _PATH_DHCLIENT_PID #define _PATH_DHCLIENT_PID "/etc/dhclient.pid" #endif diff --git a/includes/cf/rhapsody.h b/includes/cf/rhapsody.h index 27844de9d..6e980e3d4 100644 --- a/includes/cf/rhapsody.h +++ b/includes/cf/rhapsody.h @@ -63,9 +63,15 @@ extern int h_errno; #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/var/run/dhcpd.pid" #endif +#ifndef _PATH_DHCPD6_PID +#define _PATH_DHCPD6_PID "/var/run/dhcpd6.pid" +#endif #ifndef _PATH_DHCPD_DB #define _PATH_DHCPD_DB "/var/db/dhcpd.leases" #endif +#ifndef _PATH_DHCPD6_DB +#define _PATH_DHCPD6_DB "/var/db/dhcpd6.leases" +#endif #ifndef _PATH_DHCLIENT_PID #define _PATH_DHCLIENT_PID "/var/run/dhclient.pid" #endif diff --git a/includes/cf/sample.h b/includes/cf/sample.h index b3ae18706..e9ba569a5 100644 --- a/includes/cf/sample.h +++ b/includes/cf/sample.h @@ -127,9 +127,15 @@ extern int h_errno; #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/etc/dhcpd.pid" #endif +#ifndef _PATH_DHCPD6_PID +#define _PATH_DHCPD6_PID "/etc/dhcpd6.pid" +#endif #ifndef _PATH_DHCLIENT_PID #define _PATH_DHCLIENT_PID "/etc/dhclient.pid" #endif +#ifndef _PATH_DHCLIENT6_PID +#define _PATH_DHCLIENT6_PID "/etc/dhclient6.pid" +#endif #ifndef _PATH_DHCRELAY_PID #define _PATH_DHCRELAY_PID "/etc/dhcrelay.pid" #endif diff --git a/includes/cf/sco.h b/includes/cf/sco.h index f2798fc67..3554cc2c9 100644 --- a/includes/cf/sco.h +++ b/includes/cf/sco.h @@ -80,6 +80,9 @@ extern int h_errno; #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/etc/dhcpd.pid" #endif +#ifndef _PATH_DHCPD6_PID +#define _PATH_DHCPD6_PID "/etc/dhcpd6.pid" +#endif #ifndef _PATH_DHCLIENT_PID #define _PATH_DHCLIENT_PID "/etc/dhclient.pid" #endif @@ -92,6 +95,9 @@ extern int h_errno; #ifndef _PATH_DHCPD_DB #define _PATH_DHCPD_DB "/etc/dhcpd.leases" #endif +#ifndef _PATH_DHCPD6_DB +#define _PATH_DHCPD6_DB "/etc/dhcpd6.leases" +#endif #ifndef _PATH_DHCLIENT_DB #define _PATH_DHCLIENT_DB "/etc/dhclient.leases" #endif diff --git a/includes/cf/sunos4.h b/includes/cf/sunos4.h index 2c6184504..6aaf9e66f 100644 --- a/includes/cf/sunos4.h +++ b/includes/cf/sunos4.h @@ -99,6 +99,9 @@ extern int h_errno; #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/etc/dhcpd.pid" #endif +#ifndef _PATH_DHCPD6_PID +#define _PATH_DHCPD6_PID "/etc/dhcpd6.pid" +#endif #ifndef _PATH_DHCLIENT_PID #define _PATH_DHCLIENT_PID "/etc/dhclient.pid" #endif diff --git a/includes/cf/sunos5-5.h b/includes/cf/sunos5-5.h index 445ce53e1..e19b28c02 100644 --- a/includes/cf/sunos5-5.h +++ b/includes/cf/sunos5-5.h @@ -93,6 +93,9 @@ extern int h_errno; #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/etc/dhcpd.pid" #endif +#ifndef _PATH_DHCPD6_PID +#define _PATH_DHCPD6_PID "/etc/dhcpd6.pid" +#endif #ifndef _PATH_DHCLIENT_PID #define _PATH_DHCLIENT_PID "/etc/dhclient.pid" #endif diff --git a/includes/cf/ultrix.h b/includes/cf/ultrix.h index 04caa87a9..d368bf4cb 100644 --- a/includes/cf/ultrix.h +++ b/includes/cf/ultrix.h @@ -52,6 +52,9 @@ extern int h_errno; #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "/etc/dhcpd.pid" #endif +#ifndef _PATH_DHCPD6_PID +#define _PATH_DHCPD6_PID "/etc/dhcpd6.pid" +#endif #ifndef _PATH_DHCLIENT_PID #define _PATH_DHCLIENT_PID "/etc/dhclient.pid" #endif diff --git a/includes/dhcpd.h b/includes/dhcpd.h index 7c7ddba94..2df77df0f 100644 --- a/includes/dhcpd.h +++ b/includes/dhcpd.h @@ -618,6 +618,8 @@ struct lease_state { #define SV_DO_REVERSE_UPDATES 51 #define SV_FQDN_REPLY 52 #define SV_PREFER_LIFETIME 53 +#define SV_DHCPV6_LEASE_FILE_NAME 54 +#define SV_DHCPV6_PID_FILE_NAME 55 #if !defined (DEFAULT_PING_TIMEOUT) # define DEFAULT_PING_TIMEOUT 1 @@ -1224,9 +1226,14 @@ typedef unsigned char option_mask [16]; #define _PATH_DHCPD_CONF "dhcpd.conf" #undef _PATH_DHCPD_DB #define _PATH_DHCPD_DB "dhcpd.leases" +#undef _PATH_DHCPD6_DB +#define _PATH_DHCPD6_DB "dhcpd6.leases" #undef _PATH_DHCPD_PID #define _PATH_DHCPD_PID "dhcpd.pid" +#undef _PATH_DHCPD6_PID +#define _PATH_DHCPD6_PID "dhcpd6.pid" #else /* !DEBUG */ + #ifndef _PATH_DHCPD_CONF #define _PATH_DHCPD_CONF "/etc/dhcpd.conf" #endif /* DEBUG */ @@ -1235,11 +1242,20 @@ typedef unsigned char option_mask [16]; #define _PATH_DHCPD_DB LOCALSTATEDIR"/db/dhcpd.leases" #endif +#ifndef _PATH_DHCPD6_DB +#define _PATH_DHCPD6_DB LOCALSTATEDIR"/db/dhcpd6.leases" +#endif + #ifndef _PATH_DHCPD_PID #define _PATH_DHCPD_PID LOCALSTATEDIR"/run/dhcpd.pid" #endif + +#ifndef _PATH_DHCPD6_PID +#define _PATH_DHCPD6_PID LOCALSTATEDIR"/run/dhcpd6.pid" #endif +#endif /* DEBUG */ + #ifndef _PATH_DHCLIENT_CONF #define _PATH_DHCLIENT_CONF "/etc/dhclient.conf" #endif diff --git a/server/dhcpd.c b/server/dhcpd.c index d61e31b0c..93dc2c76e 100644 --- a/server/dhcpd.c +++ b/server/dhcpd.c @@ -314,6 +314,7 @@ main(int argc, char **argv) { } else if (!strcmp (argv [i], "-q")) { quiet = 1; quiet_interface_discovery = 1; +#ifdef DHCPv6 } else if (!strcmp(argv[i], "-4")) { if (local_family_set && (local_family != AF_INET)) { log_fatal("Server cannot run in both IPv4 and " @@ -328,6 +329,7 @@ main(int argc, char **argv) { } local_family = AF_INET6; local_family_set = 1; +#endif /* DHCPv6 */ } else if (!strcmp (argv [i], "--version")) { log_info("isc-dhcpd-%s", PACKAGE_VERSION); exit (0); @@ -366,12 +368,33 @@ main(int argc, char **argv) { if (!no_dhcpd_conf && (s = getenv ("PATH_DHCPD_CONF"))) { path_dhcpd_conf = s; } - if (!no_dhcpd_db && (s = getenv ("PATH_DHCPD_DB"))) { - path_dhcpd_db = s; - } - if (!no_dhcpd_pid && (s = getenv ("PATH_DHCPD_PID"))) { - path_dhcpd_pid = s; - } + +#ifdef DHCPv6 + if (local_family == AF_INET6) { + /* DHCPv6: override DHCPv4 lease and pid filenames */ + if (!no_dhcpd_db) { + if ((s = getenv ("PATH_DHCPD6_DB"))) + path_dhcpd_db = s; + else + path_dhcpd_db = _PATH_DHCPD6_DB; + } + if (!no_dhcpd_pid) { + if ((s = getenv ("PATH_DHCPD6_PID"))) + path_dhcpd_pid = s; + else + path_dhcpd_pid = _PATH_DHCPD6_PID; + } + } else +#else /* !DHCPv6 */ + { + if (!no_dhcpd_db && (s = getenv ("PATH_DHCPD_DB"))) { + path_dhcpd_db = s; + } + if (!no_dhcpd_pid && (s = getenv ("PATH_DHCPD_PID"))) { + path_dhcpd_pid = s; + } + } +#endif /* DHCPv6 */ /* * convert relative path names to absolute, for files that need @@ -738,7 +761,7 @@ void postconf_initialization (int quiet) data_string_forget (&db, MDL); path_dhcpd_db = s; } - + oc = lookup_option (&server_universe, options, SV_PID_FILE_NAME); if (oc && evaluate_option_cache (&db, (struct packet *)0, @@ -754,6 +777,44 @@ void postconf_initialization (int quiet) path_dhcpd_pid = s; } +#ifdef DHCPv6 + if (local_family == AF_INET6) { + /* + * Override lease file name with dhcpv6 lease file name, + * if it was set; then, do the same with the pid file name + */ + oc = lookup_option(&server_universe, options, + SV_DHCPV6_LEASE_FILE_NAME); + if (oc && + evaluate_option_cache(&db, NULL, NULL, NULL, + options, NULL, &global_scope, + oc, MDL)) { + s = dmalloc (db.len + 1, MDL); + if (!s) + log_fatal ("no memory for lease db filename."); + memcpy (s, db.data, db.len); + s [db.len] = 0; + data_string_forget (&db, MDL); + path_dhcpd_db = s; + } + + oc = lookup_option(&server_universe, options, + SV_DHCPV6_PID_FILE_NAME); + if (oc && + evaluate_option_cache(&db, NULL, NULL, NULL, + options, NULL, &global_scope, + oc, MDL)) { + s = dmalloc (db.len + 1, MDL); + if (!s) + log_fatal ("no memory for lease db filename."); + memcpy (s, db.data, db.len); + s [db.len] = 0; + data_string_forget (&db, MDL); + path_dhcpd_pid = s; + } + } +#endif /* DHCPv6 */ + omapi_port = -1; oc = lookup_option (&server_universe, options, SV_OMAPI_PORT); if (oc && @@ -963,7 +1024,11 @@ usage(void) { log_info(arr); log_fatal("Usage: dhcpd [-p ] [-f] [-d] [-q] [-t|-T]\n" +#ifdef DHCPv6 " [-4|-6] [-cf config-file] [-lf lease-file]\n" +#else /* !DHCPv6 */ + " [-cf config-file] [-lf lease-file]\n" +#endif /* DHCPv6 */ #if defined (TRACING) " [-tf trace-output-file]\n" " [-play trace-input-file]\n" diff --git a/server/dhcpd.conf.5 b/server/dhcpd.conf.5 index de7e8ab25..f34eef551 100644 --- a/server/dhcpd.conf.5 +++ b/server/dhcpd.conf.5 @@ -28,7 +28,7 @@ .\" see ``http://www.vix.com''. To learn more about Nominum, Inc., see .\" ``http://www.nominum.com''. .\" -.\" $Id: dhcpd.conf.5,v 1.88 2007/09/17 10:13:07 shane Exp $ +.\" $Id: dhcpd.conf.5,v 1.89 2007/10/27 19:15:36 each Exp $ .\" .TH dhcpd.conf 5 .SH NAME @@ -2230,7 +2230,36 @@ statement should be the name of the DHCP server's lease file. By default, this is DBDIR/dhcpd.leases. This statement \fBmust\fR appear in the outer scope of the configuration file - if it appears in some other scope, -it will have no effect. +it will have no effect. Furthermore, it has no effect if overridden +by the +.B -lf +flag or the +.B PATH_DHCPD_DB +environment variable. +.RE +.PP +The +.I dhcpv6-lease-file-name +statement +.RS 0.25i +.PP +.B dhcpv6-lease-file-name \fIname\fB;\fR +.PP +.I Name +is the name of the lease file to use if and only if the server is running +in DHCPv6 mode. By default, this is DBDIR/dhcpd6.leases. This statement, +like +.I lease-file-name, +\fBmust\fR appear in the outer scope of the configuration file. It +has no effect if overridden by the +.B -lf +flag or the +.B PATH_DHCPD6_DB +environment variable. If +.I dhcpv6-lease-file-name +is not specified, but +.I lease-file-name +is, the latter value will be used. .RE .PP The @@ -2422,8 +2451,36 @@ statement should be the name of the DHCP server's process ID file. This is the file in which the DHCP server's process ID is stored when the server starts. By default, this is RUNDIR/dhcpd.pid. Like the -lease-file-name statement, this statement must appear in the outer scope -of the configuration file. +.I lease-file-name +statement, this statement must appear in the outer scope +of the configuration file. It has no effect if overridden by the +.B -pf +flag or the +.B PATH_DHCPD_PID +environment variable. +.PP +The +.I dhcpv6-pid-file-name +statement +.RS 0.25i +.PP +.B dhcpv6-pid-file-name \fIname\fB;\fR +.PP +.I Name +is the name of the pid file to use if and only if the server is running +in DHCPv6 mode. By default, this is DBDIR/dhcpd6.pid. This statement, +like +.I pid-file-name, +\fBmust\fR appear in the outer scope of the configuration file. It +has no effect if overridden by the +.B -pf +flag or the +.B PATH_DHCPD6_PID +environment variable. If +.I dhcpv6-pid-file-name +is not specified, but +.I pid-file-name +is, the latter value will be used. .RE .PP The diff --git a/server/stables.c b/server/stables.c index 4e67f8e1f..ef50efb6c 100644 --- a/server/stables.c +++ b/server/stables.c @@ -235,6 +235,8 @@ static struct option server_options[] = { { "do-reverse-updates", "f", &server_universe, 51, 1 }, { "fqdn-reply", "f", &server_universe, 52, 1 }, { "preferred-lifetime", "T", &server_universe, 53, 1 }, + { "dhcpv6-lease-file-name", "t", &server_universe, 54, 1 }, + { "dhcpv6-pid-file-name", "t", &server_universe, 55, 1 }, { NULL, NULL, NULL, 0, 0 } };