mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-09-02 23:35:23 +00:00
Don't listen on an OMAPI port unless configured to do so.
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char ocopyright[] =
|
static char ocopyright[] =
|
||||||
"$Id: dhcpd.c,v 1.92 2000/06/08 21:25:47 mellon Exp $ Copyright 1995-2000 Internet Software Consortium.";
|
"$Id: dhcpd.c,v 1.93 2000/06/24 06:28:27 mellon Exp $ Copyright 1995-2000 Internet Software Consortium.";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
@@ -163,7 +163,7 @@ int main (argc, argv, envp)
|
|||||||
struct option_state *options = (struct option_state *)0;
|
struct option_state *options = (struct option_state *)0;
|
||||||
struct parse *parse;
|
struct parse *parse;
|
||||||
int lose;
|
int lose;
|
||||||
u_int16_t omapi_port;
|
int omapi_port;
|
||||||
|
|
||||||
/* Initially, log errors to stderr as well as to syslogd. */
|
/* Initially, log errors to stderr as well as to syslogd. */
|
||||||
#ifdef SYSLOG_4_2
|
#ifdef SYSLOG_4_2
|
||||||
@@ -379,7 +379,7 @@ int main (argc, argv, envp)
|
|||||||
path_dhcpd_pid = s;
|
path_dhcpd_pid = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
omapi_port = OMAPI_PROTOCOL_PORT;
|
omapi_port = -1;
|
||||||
oc = lookup_option (&server_universe, options, SV_OMAPI_PORT);
|
oc = lookup_option (&server_universe, options, SV_OMAPI_PORT);
|
||||||
if (oc &&
|
if (oc &&
|
||||||
evaluate_option_cache (&db, (struct packet *)0,
|
evaluate_option_cache (&db, (struct packet *)0,
|
||||||
@@ -482,15 +482,18 @@ int main (argc, argv, envp)
|
|||||||
icmp_startup (1, lease_pinged);
|
icmp_startup (1, lease_pinged);
|
||||||
|
|
||||||
/* 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 (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",
|
if (result != ISC_R_SUCCESS)
|
||||||
isc_result_totext (result));
|
log_fatal ("Can't allocate new generic object: %s",
|
||||||
result = omapi_protocol_listen (listener, omapi_port, 1);
|
isc_result_totext (result));
|
||||||
if (result != ISC_R_SUCCESS)
|
result = omapi_protocol_listen (listener,
|
||||||
log_fatal ("Can't start OMAPI protocol: %s",
|
(unsigned)omapi_port, 1);
|
||||||
isc_result_totext (result));
|
if (result != ISC_R_SUCCESS)
|
||||||
|
log_fatal ("Can't start OMAPI protocol: %s",
|
||||||
|
isc_result_totext (result));
|
||||||
|
}
|
||||||
|
|
||||||
#if defined (FAILOVER_PROTOCOL)
|
#if defined (FAILOVER_PROTOCOL)
|
||||||
/* Start the failover protocol. */
|
/* Start the failover protocol. */
|
||||||
|
Reference in New Issue
Block a user