From: Shane Kerr Date: Tue, 3 Jul 2007 10:34:18 +0000 (+0000) Subject: Updating the dhcpd usage() message and the dhcpd man page so they match X-Git-Tag: v4_0_0a2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2e13ba554c5bf91adb70ec30391dc003266933fc;p=thirdparty%2Fdhcp.git Updating the dhcpd usage() message and the dhcpd man page so they match the command-line arguments. See RT ticket #16922 for more. --- diff --git a/server/dhcpd.8 b/server/dhcpd.8 index 9a955596c..e561feb85 100644 --- a/server/dhcpd.8 +++ b/server/dhcpd.8 @@ -28,7 +28,7 @@ .\" see ``http://www.vix.com''. To learn more about Nominum, Inc., see .\" ``http://www.nominum.com''. .\" -.\" $Id: dhcpd.8,v 1.27 2007/05/19 19:16:26 dhankins Exp $ +.\" $Id: dhcpd.8,v 1.28 2007/07/03 10:34:18 shane Exp $ .\" .TH dhcpd 8 .SH NAME @@ -59,6 +59,10 @@ dhcpd - Dynamic Host Configuration Protocol Server .B -6 ] [ +.B -s +.I server +] +[ .B -cf .I config-file ] @@ -84,6 +88,9 @@ dhcpd - Dynamic Host Configuration Protocol Server .I ...ifN ] ] + +.B dhcpd +--version .SH DESCRIPTION The Internet Systems Consortium DHCP Server, dhcpd, implements the Dynamic Host Configuration Protocol (DHCP) and the Internet Bootstrap @@ -193,6 +200,12 @@ the flag may used. It should be followed by the udp port number on which dhcpd should listen. This is mostly useful for debugging purposes. .PP +If dhcpd should send replies to an address other than the broadcast +address (255.255.255.255), the +.B -s +flag may be used. It is followed by either the IP address or the host +name to send replies to. This option is only supported in IPv4. +.PP To run dhcpd as a foreground process, rather than allowing it to run as a daemon in the background, the .B -f @@ -251,6 +264,10 @@ using the \fB-lf\fR switch, so that the DHCP server doesn't wipe out your existing lease file with its test data. The DHCP server will refuse to operate in playback mode unless you specify an alternate lease file. +.PP +To find the version of dhcpd that will run, use the +.B --version +argument. Instead of running, the version will be printed. .SH CONFIGURATION The syntax of the dhcpd.conf(5) file is discussed separately. This section should be used as an overview of the configuration process, diff --git a/server/dhcpd.c b/server/dhcpd.c index 68270c474..c4040c28d 100644 --- a/server/dhcpd.c +++ b/server/dhcpd.c @@ -34,7 +34,7 @@ #ifndef lint static char ocopyright[] = -"$Id: dhcpd.c,v 1.128 2007/06/15 15:02:05 shane Exp $ Copyright 2004-2007 Internet Systems Consortium."; +"$Id: dhcpd.c,v 1.129 2007/07/03 10:34:18 shane Exp $ Copyright 2004-2007 Internet Systems Consortium."; #endif static char copyright[] = @@ -49,7 +49,7 @@ static char url [] = "For info, please visit http://www.isc.org/sw/dhcp/"; #include #include -static void usage PROTO ((void)); +static void usage(void); struct iaddr server_identifier; int server_identifier_matched; @@ -461,6 +461,10 @@ main(int argc, char **argv) { } if (server) { + if (local_family != AF_INET) { + log_fatal("You can only specify address to send " + "replies to when running an IPv4 server."); + } if (!inet_aton (server, &limited_broadcast)) { struct hostent *he; he = gethostbyname (server); @@ -971,21 +975,19 @@ void postdb_startup (void) /* Print usage message. */ -static void usage () -{ +static void +usage(void) { log_info("%s %s", message, PACKAGE_VERSION); - log_info (copyright); - log_info (arr); + log_info(copyright); + log_info(arr); - log_fatal ("Usage: dhcpd [-p ] [-d] [-f]%s%s%s%s", - "\n [-cf config-file] [-lf lease-file]", + log_fatal("Usage: dhcpd [-p ] [-f] [-d] [-q] [-t|-T]\n" + " [-4|-6] [-cf config-file] [-lf lease-file]\n" #if defined (TRACING) - "\n [-tf trace-output-file]", - "\n [-play trace-input-file]", -#else - "", "", + " [-tf trace-output-file]\n" + " [-play trace-input-file]\n" #endif /* TRACING */ - "\n [-t] [-T] [-s server] [if0 [...ifN]]"); + " [-pf pid-file] [-s server] [if0 [...ifN]]"); } void lease_pinged (from, packet, length)