2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 22:35:25 +00:00

Don't listen on an OMAPI port unless one is specified in the config file.

This commit is contained in:
Ted Lemon
2000-06-24 06:02:01 +00:00
parent 67e3490a34
commit 40a59753f0

View File

@@ -41,7 +41,7 @@
#ifndef lint #ifndef lint
static char ocopyright[] = static char ocopyright[] =
"$Id: dhclient.c,v 1.105 2000/06/02 21:26:57 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 Internet Software Consortium. All rights reserved.\n"; "$Id: dhclient.c,v 1.106 2000/06/24 06:02:01 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@@ -103,6 +103,7 @@ int main (argc, argv, envp)
omapi_object_t *listener; omapi_object_t *listener;
isc_result_t result; isc_result_t result;
int persist = 0; int persist = 0;
int omapi_port;
#ifdef SYSLOG_4_2 #ifdef SYSLOG_4_2
openlog ("dhclient", LOG_NDELAY); openlog ("dhclient", LOG_NDELAY);
@@ -370,16 +371,20 @@ int main (argc, argv, envp)
return 0; return 0;
/* Start up a listener for the object management API protocol. */ /* Start up a listener for the object management API protocol. */
listener = (omapi_object_t *)0; if (top_level_config.omapi_port != -1) {
result = omapi_generic_new (&listener, MDL); listener = (omapi_object_t *)0;
if (result != ISC_R_SUCCESS) result = omapi_generic_new (&listener, MDL);
log_fatal ("Can't allocate new generic object: %s\n", if (result != ISC_R_SUCCESS)
isc_result_totext (result)); log_fatal ("Can't allocate new generic object: %s\n",
result = omapi_protocol_listen (listener, isc_result_totext (result));
OMAPI_PROTOCOL_PORT + 1, 1); result = omapi_protocol_listen (listener,
if (result != ISC_R_SUCCESS) (unsigned)
log_fatal ("Can't start OMAPI protocol: %s", top_level_config.omapi_port,
isc_result_totext (result)); 1);
if (result != ISC_R_SUCCESS)
log_fatal ("Can't start OMAPI protocol: %s",
isc_result_totext (result));
}
/* Set up the bootp packet handler... */ /* Set up the bootp packet handler... */
bootp_packet_handler = do_packet; bootp_packet_handler = do_packet;