summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-04-20 00:27:58 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-04-20 00:27:58 +0000
commitf01d6ee7ec0a2d13b442dfaa8615c77d759f3d25 (patch)
tree54c33e8a4383628c2aa4f5b3d67d529d519005d6
parent3fa090319bf5a204a106e44601fa7f6f23b9f19a (diff)
don't allow the port to be changed here either
-rw-r--r--usr.sbin/dhcpd/dhcpd.822
-rw-r--r--usr.sbin/dhcpd/dhcpd.c25
2 files changed, 6 insertions, 41 deletions
diff --git a/usr.sbin/dhcpd/dhcpd.8 b/usr.sbin/dhcpd/dhcpd.8
index 23311072f85..a6ce9037880 100644
--- a/usr.sbin/dhcpd/dhcpd.8
+++ b/usr.sbin/dhcpd/dhcpd.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: dhcpd.8,v 1.2 2004/04/15 08:34:20 jmc Exp $
+.\" $OpenBSD: dhcpd.8,v 1.3 2004/04/20 00:27:57 henning Exp $
.\"
.\" Copyright (c) 1995, 1996 The Internet Software Consortium.
.\" All rights reserved.
@@ -47,7 +47,6 @@
.Op Fl df
.Op Fl c Ar config-file
.Op Fl l Ar lease-file
-.Op Fl p Ar port
.Op Ar if0 Op Ar ... ifN
.Sh DESCRIPTION
The Internet Software Consortium DHCP Server,
@@ -212,25 +211,6 @@ running
in production, this option should be used
.Em only
for testing lease files in a non-production environment.
-.It Fl p Ar port
-Tell
-.Nm
-to listen on a port other than the standard (port 67).
-It should be followed by the UDP port number on which
-.Nm
-should listen.
-This is mostly useful for debugging purposes.
-The server will transmit responses to clients at a
-port number that is one greater than the one specified \- i.e., if you
-specify
-.Fl p
-67, then the server will listen on port 67 and transmit to port 68.
-Datagrams that must go through relay agents are sent to the port
-number specified with the
-.Fl p
-flag.
-If you wish to use alternate port numbers, you must configure
-any relay agents you are using to use the same alternate port numbers.
.El
.Sh CONFIGURATION
The syntax of the
diff --git a/usr.sbin/dhcpd/dhcpd.c b/usr.sbin/dhcpd/dhcpd.c
index ead62341689..4803fd1c1a8 100644
--- a/usr.sbin/dhcpd/dhcpd.c
+++ b/usr.sbin/dhcpd/dhcpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhcpd.c,v 1.14 2004/04/18 00:43:27 deraadt Exp $ */
+/* $OpenBSD: dhcpd.c,v 1.15 2004/04/20 00:27:57 henning Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@cvs.openbsd.org>
@@ -61,8 +61,7 @@ char *path_dhcpd_db = _PATH_DHCPD_DB;
int
main(int argc, char *argv[])
{
- int ch, status, cftest = 0, quiet = 0, daemonize = 1;
- struct servent *ent;
+ int ch, cftest = 0, quiet = 0, daemonize = 1;
struct passwd *pw;
extern char *__progname;
@@ -70,7 +69,7 @@ main(int argc, char *argv[])
openlog(__progname, LOG_NDELAY, DHCPD_LOG_FACILITY);
setlogmask(LOG_UPTO(LOG_INFO));
- while ((ch = getopt(argc, argv, "c:dfl:p:tq")) != -1)
+ while ((ch = getopt(argc, argv, "c:dfl:tq")) != -1)
switch (ch) {
case 'c':
path_dhcpd_conf = optarg;
@@ -85,12 +84,6 @@ main(int argc, char *argv[])
case 'l':
path_dhcpd_db = optarg;
break;
- case 'p':
- status = atoi(optarg);
- if (status < 1 || status > 65535)
- error("%s: not a valid UDP port", optarg);
- local_port = htons(status);
- break;
case 'q':
quiet = 1;
quiet_interface_discovery = 1;
@@ -122,17 +115,9 @@ main(int argc, char *argv[])
if (quiet)
log_perror = 0;
- /* Default to the DHCP/BOOTP port. */
- if (!local_port) {
- ent = getservbyname("dhcp", "udp");
- if (!ent)
- local_port = htons(67);
- else
- local_port = ent->s_port;
- endservent();
- }
+ local_port = htons(67);
+ remote_port = htons(68);
- remote_port = htons(ntohs(local_port) + 1);
time(&cur_time);
if (!readconf())
error("Configuration file errors encountered -- exiting");