pull in code patches from usr.sbin/dhcp
This commit is contained in:
parent
b51ccd5322
commit
e0c9112eff
|
@ -43,7 +43,7 @@
|
|||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"$Id: clparse.c,v 1.1.1.1 2001/08/03 11:35:30 drochner Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
|
||||
"$Id: clparse.c,v 1.2 2001/08/03 13:07:03 drochner Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "dhcpd.h"
|
||||
|
@ -165,8 +165,13 @@ int read_client_conf_file (const char *name, struct interface_info *ip,
|
|||
int token;
|
||||
isc_result_t status;
|
||||
|
||||
if ((file = open (name, O_RDONLY)) < 0)
|
||||
if ((file = open (name, O_RDONLY)) < 0) {
|
||||
#ifndef SMALL
|
||||
return uerr2isc (errno);
|
||||
#else
|
||||
return errno == ENOENT ? ISC_R_NOTFOUND : ISC_R_NOPERM;
|
||||
#endif
|
||||
}
|
||||
|
||||
cfile = (struct parse *)0;
|
||||
new_parse (&cfile, file, (char *)0, 0, path_dhclient_conf, 0);
|
||||
|
@ -275,6 +280,7 @@ void parse_client_statement (cfile, ip, config)
|
|||
}
|
||||
return;
|
||||
|
||||
#if !defined (SMALL)
|
||||
case KEY:
|
||||
next_token (&val, (unsigned *)0, cfile);
|
||||
if (ip) {
|
||||
|
@ -296,6 +302,7 @@ void parse_client_statement (cfile, ip, config)
|
|||
}
|
||||
parse_key (cfile);
|
||||
return;
|
||||
#endif
|
||||
|
||||
/* REQUIRE can either start a policy statement or a
|
||||
comma-seperated list of names of required options. */
|
||||
|
@ -952,6 +959,7 @@ void parse_client_lease_declaration (cfile, lease, ipp, clientp)
|
|||
struct data_string key_id;
|
||||
|
||||
switch (next_token (&val, (unsigned *)0, cfile)) {
|
||||
#if !defined (SMALL)
|
||||
case KEY:
|
||||
token = next_token (&val, (unsigned *)0, cfile);
|
||||
if (token != STRING && !is_identifier (token)) {
|
||||
|
@ -964,6 +972,7 @@ void parse_client_lease_declaration (cfile, lease, ipp, clientp)
|
|||
parse_warn (cfile, "unknown key %s", val);
|
||||
parse_semi (cfile);
|
||||
break;
|
||||
#endif
|
||||
case TOKEN_BOOTP:
|
||||
lease -> is_bootp = 1;
|
||||
break;
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
#ifndef lint
|
||||
static char ocopyright[] =
|
||||
"$Id: dhclient.c,v 1.1.1.1 2001/08/03 11:35:30 drochner Exp $ Copyright (c) 1995-2001 Internet Software Consortium. All rights reserved.\n";
|
||||
"$Id: dhclient.c,v 1.2 2001/08/03 13:07:03 drochner Exp $ Copyright (c) 1995-2001 Internet Software Consortium. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "dhcpd.h"
|
||||
|
@ -426,6 +426,7 @@ int main (argc, argv, envp)
|
|||
if (release_mode)
|
||||
return 0;
|
||||
|
||||
#if !defined (SMALL)
|
||||
/* Start up a listener for the object management API protocol. */
|
||||
if (top_level_config.omapi_port != -1) {
|
||||
listener = (omapi_object_t *)0;
|
||||
|
@ -441,6 +442,7 @@ int main (argc, argv, envp)
|
|||
log_fatal ("Can't start OMAPI protocol: %s",
|
||||
isc_result_totext (result));
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Set up the bootp packet handler... */
|
||||
bootp_packet_handler = do_packet;
|
||||
|
@ -3021,6 +3023,7 @@ void client_dns_update (struct client_state *client, int addp)
|
|||
&global_scope, oc, MDL))
|
||||
return;
|
||||
|
||||
#ifndef SMALL
|
||||
/* Make a dhcid string out of either the client identifier,
|
||||
if we are sending one, or the interface's MAC address,
|
||||
otherwise. */
|
||||
|
@ -3073,4 +3076,5 @@ void client_dns_update (struct client_state *client, int addp)
|
|||
|
||||
data_string_forget (&ddns_fwd_name, MDL);
|
||||
data_string_forget (&ddns_dhcid, MDL);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"$Id: bpf.c,v 1.1.1.1 2001/08/03 11:35:31 drochner Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
|
||||
"$Id: bpf.c,v 1.2 2001/08/03 13:07:03 drochner Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "dhcpd.h"
|
||||
|
@ -210,7 +210,7 @@ struct bpf_insn dhcp_bpf_filter [] = {
|
|||
BPF_STMT(BPF_RET+BPF_K, 0),
|
||||
};
|
||||
|
||||
#if defined (DEC_FDDI)
|
||||
#if defined(DEC_FDDI) || defined(NETBSD_FDDI)
|
||||
struct bpf_insn *bpf_fddi_filter;
|
||||
#endif
|
||||
|
||||
|
@ -241,9 +241,9 @@ void if_register_receive (info)
|
|||
u_int32_t addr;
|
||||
struct bpf_program p;
|
||||
u_int32_t bits;
|
||||
#ifdef DEC_FDDI
|
||||
#if defined(DEC_FDDI) || defined(NETBSD_FDDI)
|
||||
int link_layer;
|
||||
#endif /* DEC_FDDI */
|
||||
#endif /* DEC_FDDI || NETBSD_FDDI */
|
||||
|
||||
/* Open a BPF device and hang it on this interface... */
|
||||
info -> rfdesc = if_register_bpf (info);
|
||||
|
@ -290,7 +290,7 @@ void if_register_receive (info)
|
|||
/* Set up the bpf filter program structure. */
|
||||
p.bf_len = dhcp_bpf_filter_len;
|
||||
|
||||
#ifdef DEC_FDDI
|
||||
#if defined(DEC_FDDI) || defined(NETBSD_FDDI)
|
||||
/* See if this is an FDDI interface, flag it for later. */
|
||||
if (ioctl(info -> rfdesc, BIOCGDLT, &link_layer) >= 0 &&
|
||||
link_layer == DLT_FDDI) {
|
||||
|
@ -314,7 +314,7 @@ void if_register_receive (info)
|
|||
}
|
||||
p.bf_insns = bpf_fddi_filter;
|
||||
} else
|
||||
#endif /* DEC_FDDI */
|
||||
#endif /* DEC_FDDI || NETBSD_FDDI */
|
||||
p.bf_insns = dhcp_bpf_filter;
|
||||
|
||||
/* Patch the server port into the BPF program...
|
||||
|
@ -442,6 +442,10 @@ ssize_t receive_packet (interface, buf, len, from, hfrom)
|
|||
continue;
|
||||
}
|
||||
|
||||
/* Adjust for any padding BPF inserted between the packets. */
|
||||
interface -> rbuf_offset =
|
||||
BPF_WORDALIGN (interface -> rbuf_offset);
|
||||
|
||||
/* Copy out a bpf header... */
|
||||
memcpy (&hdr, &interface -> rbuf [interface -> rbuf_offset],
|
||||
sizeof hdr);
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"$Id: comapi.c,v 1.1.1.1 2001/08/03 11:35:31 drochner Exp $ Copyright (c) 1999-2001 The Internet Software Consortium. All rights reserved.\n";
|
||||
"$Id: comapi.c,v 1.2 2001/08/03 13:07:03 drochner Exp $ Copyright (c) 1999-2001 The Internet Software Consortium. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "dhcpd.h"
|
||||
|
@ -331,6 +331,7 @@ isc_result_t dhcp_group_stuff_values (omapi_object_t *c,
|
|||
return ISC_R_INVALIDARG;
|
||||
group = (struct group_object *)h;
|
||||
|
||||
#if !defined (SMALL)
|
||||
/* Write out all the values. */
|
||||
if (group -> name) {
|
||||
status = omapi_connection_put_name (c, "name");
|
||||
|
@ -340,6 +341,7 @@ isc_result_t dhcp_group_stuff_values (omapi_object_t *c,
|
|||
if (status != ISC_R_SUCCESS)
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Write out the inner object, if any. */
|
||||
if (h -> inner && h -> inner -> type -> stuff_values) {
|
||||
|
@ -560,6 +562,7 @@ isc_result_t dhcp_control_stuff_values (omapi_object_t *c,
|
|||
return ISC_R_INVALIDARG;
|
||||
control = (dhcp_control_object_t *)h;
|
||||
|
||||
#ifndef SMALL
|
||||
/* Write out all the values. */
|
||||
status = omapi_connection_put_name (c, "state");
|
||||
if (status != ISC_R_SUCCESS)
|
||||
|
@ -570,6 +573,7 @@ isc_result_t dhcp_control_stuff_values (omapi_object_t *c,
|
|||
status = omapi_connection_put_uint32 (c, control -> state);
|
||||
if (status != ISC_R_SUCCESS)
|
||||
return status;
|
||||
#endif
|
||||
|
||||
/* Write out the inner object, if any. */
|
||||
if (h -> inner && h -> inner -> type -> stuff_values) {
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"$Id: discover.c,v 1.1.1.1 2001/08/03 11:35:32 drochner Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
|
||||
"$Id: discover.c,v 1.2 2001/08/03 13:07:04 drochner Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "dhcpd.h"
|
||||
|
@ -84,6 +84,16 @@ isc_result_t interface_setup ()
|
|||
isc_result_t status;
|
||||
status = omapi_object_type_register (&dhcp_type_interface,
|
||||
"interface",
|
||||
#ifdef SMALL
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
#else
|
||||
dhcp_interface_set_value,
|
||||
dhcp_interface_get_value,
|
||||
dhcp_interface_destroy,
|
||||
|
@ -92,6 +102,7 @@ isc_result_t interface_setup ()
|
|||
dhcp_interface_lookup,
|
||||
dhcp_interface_create,
|
||||
dhcp_interface_remove,
|
||||
#endif
|
||||
0, 0, 0,
|
||||
sizeof (struct interface_info),
|
||||
interface_initialize);
|
||||
|
@ -296,7 +307,15 @@ void discover_interfaces (state)
|
|||
#else
|
||||
tmp -> hw_address.hlen = 6; /* XXX!!! */
|
||||
#endif
|
||||
tmp -> hw_address.hbuf [0] = HTYPE_ETHER; /* XXX */
|
||||
if (foo -> sdl_type == IFT_ETHER) {
|
||||
tmp -> hw_address.hbuf [0] = HTYPE_ETHER;
|
||||
#if defined (DEC_FDDI) || defined(NETBSD_FDDI)
|
||||
} else if (foo -> sdl_type == IFT_FDDI) {
|
||||
tmp -> hw_address.hbuf [0] = HTYPE_FDDI;
|
||||
#endif
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
memcpy (&tmp -> hw_address.hbuf [1],
|
||||
LLADDR (foo), tmp -> hw_address.hlen);
|
||||
tmp -> hw_address.hlen++; /* for type. */
|
||||
|
@ -305,10 +324,11 @@ void discover_interfaces (state)
|
|||
|
||||
if (ifp -> ifr_addr.sa_family == AF_INET) {
|
||||
struct iaddr addr;
|
||||
void *ptr;
|
||||
|
||||
/* Get a pointer to the address... */
|
||||
memcpy (&foo, &ifp -> ifr_addr,
|
||||
sizeof ifp -> ifr_addr);
|
||||
ptr = &ifp -> ifr_addr;
|
||||
memcpy (&foo, ptr, sizeof ifp -> ifr_addr);
|
||||
|
||||
/* We don't want the loopback interface. */
|
||||
if (foo.sin_addr.s_addr == htonl (INADDR_LOOPBACK) &&
|
||||
|
@ -761,14 +781,6 @@ isc_result_t got_one (h)
|
|||
if (result == 0)
|
||||
return ISC_R_UNEXPECTED;
|
||||
|
||||
/* If we didn't at least get the fixed portion of the BOOTP
|
||||
packet, drop the packet. We're allowing packets with no
|
||||
sname or filename, because we're aware of at least one
|
||||
client that sends such packets, but this definitely falls
|
||||
into the category of being forgiving. */
|
||||
if (result < DHCP_FIXED_NON_UDP - DHCP_SNAME_LEN - DHCP_FILE_LEN)
|
||||
return ISC_R_UNEXPECTED;
|
||||
|
||||
if (bootp_packet_handler) {
|
||||
ifrom.len = 4;
|
||||
memcpy (ifrom.iabuf, &from.sin_addr, ifrom.len);
|
||||
|
@ -784,6 +796,7 @@ isc_result_t got_one (h)
|
|||
return ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
#if !defined (SMALL)
|
||||
isc_result_t dhcp_interface_set_value (omapi_object_t *h,
|
||||
omapi_object_t *id,
|
||||
omapi_data_string_t *name,
|
||||
|
@ -1031,6 +1044,7 @@ isc_result_t dhcp_interface_create (omapi_object_t **lp,
|
|||
interface_dereference (&hp, MDL);
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
|
||||
isc_result_t dhcp_interface_remove (omapi_object_t *lp,
|
||||
omapi_object_t *id)
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"$Id: dns.c,v 1.1.1.1 2001/08/03 11:35:32 drochner Exp $ Copyright (c) 2001 The Internet Software Consortium. All rights reserved.\n";
|
||||
"$Id: dns.c,v 1.2 2001/08/03 13:07:04 drochner Exp $ Copyright (c) 2001 The Internet Software Consortium. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "dhcpd.h"
|
||||
|
@ -224,6 +224,9 @@ isc_result_t dns_zone_lookup (struct dns_zone **zone, const char *name)
|
|||
return ISC_R_NOTFOUND;
|
||||
|
||||
len = strlen (name);
|
||||
if (len == 0)
|
||||
return ISC_R_NOTFOUND;
|
||||
|
||||
if (name [len - 1] != '.') {
|
||||
tname = dmalloc ((unsigned)len + 2, MDL);
|
||||
if (!tname)
|
||||
|
@ -281,8 +284,10 @@ int dns_zone_dereference (ptr, file, line)
|
|||
|
||||
if (dns_zone -> name)
|
||||
dfree (dns_zone -> name, file, line);
|
||||
#if !defined (SMALL)
|
||||
if (dns_zone -> key)
|
||||
omapi_auth_key_dereference (&dns_zone -> key, file, line);
|
||||
#endif
|
||||
if (dns_zone -> primary)
|
||||
option_cache_dereference (&dns_zone -> primary, file, line);
|
||||
if (dns_zone -> secondary)
|
||||
|
|
|
@ -43,14 +43,22 @@
|
|||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"$Id: fddi.c,v 1.1.1.1 2001/08/03 11:35:32 drochner Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
|
||||
"$Id: fddi.c,v 1.2 2001/08/03 13:07:04 drochner Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "dhcpd.h"
|
||||
|
||||
#if defined (DEC_FDDI) || defined (NETBSD_FDDI)
|
||||
#if defined (DEC_FDDI)
|
||||
#include <netinet/if_fddi.h>
|
||||
#include <net/if_llc.h>
|
||||
#endif /* DEC_FDDI */
|
||||
|
||||
#if defined (NETBSD_FDDI)
|
||||
#include <net/if_fddi.h>
|
||||
#include <net/if_llc.h>
|
||||
#define LLC_SNAP_LEN LLC_SNAPFRAMELEN
|
||||
#endif /* NETBSD_FDDI */
|
||||
|
||||
#if defined (PACKET_ASSEMBLY) || defined (PACKET_DECODING)
|
||||
#include "includes/netinet/if_ether.h"
|
||||
|
@ -77,6 +85,7 @@ void assemble_fddi_header (interface, buf, bufix, to)
|
|||
memcpy (&buf [*bufix], &fh, sizeof fh);
|
||||
*bufix += sizeof fh;
|
||||
|
||||
memset (&lh, 0, sizeof lh);
|
||||
lh.llc_dsap = LLC_SNAP_LSAP;
|
||||
lh.llc_ssap = LLC_SNAP_LSAP;
|
||||
lh.llc_un.type_snap.control = LLC_UI;
|
||||
|
@ -97,10 +106,13 @@ ssize_t decode_fddi_header (interface, buf, bufix, from)
|
|||
{
|
||||
struct fddi_header fh;
|
||||
struct llc lh;
|
||||
|
||||
|
||||
memcpy(&fh, buf + bufix, FDDI_HEADER_SIZE);
|
||||
|
||||
from -> hbuf [0] = HTYPE_FDDI;
|
||||
from -> hlen = (sizeof fh.fddi_shost) + 1;
|
||||
memcpy (&from -> hbuf [1], fh.fddi_shost, sizeof fh.fddi_shost);
|
||||
return FDDI_HEADER_SIZE + LLC_SNAP_LEN;
|
||||
}
|
||||
#endif /* PACKET_DECODING */
|
||||
#endif /* DEC_FDDI */
|
||||
#endif /* DEC_FDDI || NETBSD_FDDI */
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"$Id: packet.c,v 1.1.1.1 2001/08/03 11:35:32 drochner Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
|
||||
"$Id: packet.c,v 1.2 2001/08/03 13:07:04 drochner Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "dhcpd.h"
|
||||
|
@ -124,7 +124,7 @@ void assemble_hw_header (interface, buf, bufix, to)
|
|||
assemble_tr_header (interface, buf, bufix, to);
|
||||
else
|
||||
#endif
|
||||
#if defined (DEC_FDDI)
|
||||
#if defined (DEC_FDDI) || defined (NETBSD_FDDI)
|
||||
if (interface -> hw_address.hbuf [0] == HTYPE_FDDI)
|
||||
assemble_fddi_header (interface, buf, bufix, to);
|
||||
else
|
||||
|
@ -209,7 +209,7 @@ ssize_t decode_hw_header (interface, buf, bufix, from)
|
|||
return decode_tr_header (interface, buf, bufix, from);
|
||||
else
|
||||
#endif
|
||||
#if defined (DEC_FDDI)
|
||||
#if defined (DEC_FDDI) || defined (NETBSD_FDDI)
|
||||
if (interface -> hw_address.hbuf [0] == HTYPE_FDDI)
|
||||
return decode_fddi_header (interface, buf, bufix, from);
|
||||
else
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"$Id: parse.c,v 1.1.1.1 2001/08/03 11:35:33 drochner Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
|
||||
"$Id: parse.c,v 1.2 2001/08/03 13:07:04 drochner Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "dhcpd.h"
|
||||
|
@ -1982,6 +1982,7 @@ int parse_executable_statement (result, cfile, lose, case_context)
|
|||
return 1;
|
||||
|
||||
/* Also not really a statement, but same idea as above. */
|
||||
#if !defined (SMALL)
|
||||
case KEY:
|
||||
token = next_token (&val, (unsigned *)0, cfile);
|
||||
if (!parse_key (cfile)) {
|
||||
|
@ -1989,6 +1990,7 @@ int parse_executable_statement (result, cfile, lose, case_context)
|
|||
return 0;
|
||||
}
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
default:
|
||||
if (config_universe && is_identifier (token)) {
|
||||
|
@ -2121,6 +2123,7 @@ int parse_zone (struct dns_zone *zone, struct parse *cfile)
|
|||
}
|
||||
break;
|
||||
|
||||
#if !defined (SMALL)
|
||||
case KEY:
|
||||
token = next_token (&val, (unsigned *)0, cfile);
|
||||
token = peek_token (&val, (unsigned *)0, cfile);
|
||||
|
@ -2144,7 +2147,8 @@ int parse_zone (struct dns_zone *zone, struct parse *cfile)
|
|||
if (!parse_semi (cfile))
|
||||
return 0;
|
||||
break;
|
||||
|
||||
#endif
|
||||
|
||||
default:
|
||||
done = 1;
|
||||
break;
|
||||
|
@ -2167,6 +2171,7 @@ int parse_zone (struct dns_zone *zone, struct parse *cfile)
|
|||
secret-definition :== SECRET base64val |
|
||||
SECRET STRING */
|
||||
|
||||
#if !defined (SMALL)
|
||||
int parse_key (struct parse *cfile)
|
||||
{
|
||||
int token;
|
||||
|
@ -2306,6 +2311,7 @@ int parse_key (struct parse *cfile)
|
|||
omapi_auth_key_dereference (&key, MDL);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* on-statement :== event-types LBRACE executable-statements RBRACE
|
||||
|
@ -4760,7 +4766,10 @@ int parse_warn (struct parse *cfile, const char *fmt, ...)
|
|||
#endif
|
||||
|
||||
va_start (list, fmt);
|
||||
vsnprintf (mbuf, sizeof mbuf, fbuf, list);
|
||||
|
||||
fmt = fbuf;
|
||||
vsnprintf (mbuf, sizeof mbuf, fmt, list);
|
||||
|
||||
va_end (list);
|
||||
|
||||
lix = 0;
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"$Id: print.c,v 1.1.1.1 2001/08/03 11:35:33 drochner Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
|
||||
"$Id: print.c,v 1.2 2001/08/03 13:07:04 drochner Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "dhcpd.h"
|
||||
|
@ -309,7 +309,7 @@ void dump_raw (buf, len)
|
|||
for (i = 0; i < len; i++) {
|
||||
if ((i & 15) == 0) {
|
||||
if (lbix)
|
||||
log_info (lbuf);
|
||||
log_info ("%s", lbuf);
|
||||
sprintf (lbuf, "%03x:", i);
|
||||
lbix = 4;
|
||||
} else if ((i & 7) == 0)
|
||||
|
@ -317,7 +317,7 @@ void dump_raw (buf, len)
|
|||
sprintf (&lbuf [lbix], " %02x", buf [i]);
|
||||
lbix += 3;
|
||||
}
|
||||
log_info (lbuf);
|
||||
log_info ("%s", lbuf);
|
||||
}
|
||||
|
||||
void hash_dump (table)
|
||||
|
@ -337,7 +337,7 @@ void hash_dump (table)
|
|||
if (bp -> len)
|
||||
dump_raw (bp -> name, bp -> len);
|
||||
else
|
||||
log_info ((const char *)bp -> name);
|
||||
log_info ("%s", (const char *)bp -> name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1363,8 +1363,8 @@ void print_dns_status (int status, ns_updque *uq)
|
|||
*s++ = '.';
|
||||
*s++ = 0;
|
||||
if (errorp)
|
||||
log_error (obuf);
|
||||
log_error ("%s", obuf);
|
||||
else
|
||||
log_info (obuf);
|
||||
log_info ("%s", obuf);
|
||||
}
|
||||
#endif /* NSUPDATE */
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"$Id: tables.c,v 1.1.1.1 2001/08/03 11:35:33 drochner Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
|
||||
"$Id: tables.c,v 1.2 2001/08/03 13:07:04 drochner Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "dhcpd.h"
|
||||
|
@ -191,11 +191,11 @@ struct option dhcp_options [256] = {
|
|||
{ "#90", "X", &dhcp_universe, 90 },
|
||||
{ "#91", "X", &dhcp_universe, 91 },
|
||||
{ "#92", "X", &dhcp_universe, 92 },
|
||||
{ "#93", "X", &dhcp_universe, 93 },
|
||||
{ "#94", "X", &dhcp_universe, 94 },
|
||||
{ "pxe-client-arch-id", "X", &dhcp_universe, 93 },
|
||||
{ "pxe-client-netif-id", "X", &dhcp_universe, 94 },
|
||||
{ "#95", "X", &dhcp_universe, 95 },
|
||||
{ "#96", "X", &dhcp_universe, 96 },
|
||||
{ "#97", "X", &dhcp_universe, 97 },
|
||||
{ "pxe-uuid", "X", &dhcp_universe, 97 },
|
||||
{ "uap-servers", "t", &dhcp_universe, 98 },
|
||||
{ "#99", "X", &dhcp_universe, 99 },
|
||||
{ "#100", "X", &dhcp_universe, 100 },
|
||||
|
|
|
@ -82,6 +82,14 @@ extern int h_errno;
|
|||
#define _PATH_DHCLIENT_DB "/var/db/dhclient.leases"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If building "SMALL" (e.g. for an installation disk), do not configure
|
||||
* for DNS update functionality -- overrides default set in ../site.h.
|
||||
*/
|
||||
#if defined(SMALL) && defined(NSUPDATE)
|
||||
#undef NSUPDATE
|
||||
#endif
|
||||
|
||||
#define EOL '\n'
|
||||
#define VOIDPTR void *
|
||||
|
||||
|
@ -95,9 +103,12 @@ extern int h_errno;
|
|||
|
||||
#if defined (USE_DEFAULT_NETWORK)
|
||||
# define USE_BPF
|
||||
# define NETBSD_FDDI
|
||||
# define FDDI_HEADER_SIZE 16
|
||||
# include <net/if_types.h>
|
||||
#endif
|
||||
|
||||
#ifdef __alpha__
|
||||
#if defined(__alpha__) || defined(__sparc_v9__)
|
||||
#define PTRSIZE_64BIT
|
||||
#endif
|
||||
|
||||
|
|
|
@ -159,7 +159,16 @@ struct dhcp_packet {
|
|||
#define DHO_USER_CLASS 77
|
||||
#define DHO_FQDN 81
|
||||
#define DHO_DHCP_AGENT_OPTIONS 82
|
||||
|
||||
/* Options 93, 94, and 97 are define in the Intel Preboot Execution
|
||||
Environment (PXE) specification, version 2.1, September 20, 1999,
|
||||
page 19. */
|
||||
#define DHO_PXE_CLIENT_ARCH_ID 93
|
||||
#define DHO_PXE_CLIENT_NETIF_ID 94
|
||||
#define DHO_PXE_UUID 97
|
||||
|
||||
#define DHO_SUBNET_SELECTION 118 /* RFC3011! */
|
||||
|
||||
/* The DHO_AUTHENTICATE option is not a standard yet, so I've
|
||||
allocated an option out of the "local" option space for it on a
|
||||
temporary basis. Once an option code number is assigned, I will
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
|
||||
/* This is the number of history entries to maintain - by default, 256. */
|
||||
|
||||
/* #define RC_HISTORY_MAX 10240 */
|
||||
/* #define RC_HISTORY_MAX 1024 */
|
||||
|
||||
/* Define this if you want dhcpd to dump core when a non-fatal memory
|
||||
allocation error is detected (i.e., something that would cause a
|
||||
|
@ -171,4 +171,6 @@
|
|||
/* Define this if you want to be able to save and playback server operational
|
||||
traces. */
|
||||
|
||||
#ifndef SMALL
|
||||
#define TRACING
|
||||
#endif
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "$Id: ns_samedomain.c,v 1.1.1.1 2001/08/03 11:35:36 drochner Exp $";
|
||||
static const char rcsid[] = "$Id: ns_samedomain.c,v 1.2 2001/08/03 13:07:05 drochner Exp $";
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -168,7 +168,7 @@ ns_makecanon(const char *src, char *dst, size_t dstsize) {
|
|||
size_t n = strlen(src);
|
||||
|
||||
if (n + sizeof "." > dstsize) {
|
||||
ISC_R_NOSPACE;
|
||||
return ISC_R_NOSPACE;
|
||||
}
|
||||
strcpy(dst, src);
|
||||
while (n > 0 && dst[n - 1] == '.') /* Ends in "." */
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
#ifndef lint
|
||||
static const char rcsid[] = "$Id: ns_sign.c,v 1.1.1.1 2001/08/03 11:35:36 drochner Exp $";
|
||||
static const char rcsid[] = "$Id: ns_sign.c,v 1.2 2001/08/03 13:07:05 drochner Exp $";
|
||||
#endif
|
||||
|
||||
#if defined (TRACING)
|
||||
|
@ -87,7 +87,7 @@ ns_sign(u_char *msg, unsigned *msglen, unsigned msgsize, int error, void *k,
|
|||
|
||||
dst_init();
|
||||
if (msg == NULL || msglen == NULL || sig == NULL || siglen == NULL)
|
||||
ISC_R_INVALIDARG;
|
||||
return ISC_R_INVALIDARG;
|
||||
|
||||
/* Name. */
|
||||
if (key != NULL && error != ns_r_badsig && error != ns_r_badkey)
|
||||
|
@ -118,7 +118,7 @@ ns_sign(u_char *msg, unsigned *msglen, unsigned msgsize, int error, void *k,
|
|||
else
|
||||
n = dn_comp("", cp, (unsigned)(eob - cp), NULL, NULL);
|
||||
if (n < 0)
|
||||
ISC_R_NOSPACE;
|
||||
return ISC_R_NOSPACE;
|
||||
alg = cp;
|
||||
cp += n;
|
||||
|
||||
|
@ -190,7 +190,7 @@ ns_sign(u_char *msg, unsigned *msglen, unsigned msgsize, int error, void *k,
|
|||
n = dst_sign_data(SIG_MODE_FINAL, key, &ctx, NULL, 0,
|
||||
sig, *siglen);
|
||||
if (n < 0)
|
||||
ISC_R_BADKEY;
|
||||
return ISC_R_BADKEY;
|
||||
*siglen = n;
|
||||
} else
|
||||
*siglen = 0;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#if !defined(lint) && !defined(SABER)
|
||||
static const char rcsid[] = "$Id: res_findzonecut.c,v 1.1.1.1 2001/08/03 11:35:36 drochner Exp $";
|
||||
static const char rcsid[] = "$Id: res_findzonecut.c,v 1.2 2001/08/03 13:07:05 drochner Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
|
@ -355,7 +355,7 @@ get_soa(res_state statp, const char *dname, ns_class class,
|
|||
while (*dname != '.') {
|
||||
if (*dname == '\\')
|
||||
if (*++dname == '\0') {
|
||||
ISC_R_NOSPACE;
|
||||
return ISC_R_NOSPACE;
|
||||
}
|
||||
dname++;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"$Id: errwarn.c,v 1.1.1.1 2001/08/03 11:35:37 drochner Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||
"$Id: errwarn.c,v 1.2 2001/08/03 13:07:05 drochner Exp $ Copyright (c) 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <omapip/omapip_p.h>
|
||||
|
@ -69,7 +69,8 @@ void log_fatal (const char * fmt, ... )
|
|||
do_percentm (fbuf, fmt);
|
||||
|
||||
va_start (list, fmt);
|
||||
vsnprintf (mbuf, sizeof mbuf, fbuf, list);
|
||||
fmt = fbuf;
|
||||
vsnprintf (mbuf, sizeof mbuf, fmt, list);
|
||||
va_end (list);
|
||||
|
||||
#ifndef DEBUG
|
||||
|
@ -115,7 +116,8 @@ int log_error (const char * fmt, ...)
|
|||
do_percentm (fbuf, fmt);
|
||||
|
||||
va_start (list, fmt);
|
||||
vsnprintf (mbuf, sizeof mbuf, fbuf, list);
|
||||
fmt = fbuf;
|
||||
vsnprintf (mbuf, sizeof mbuf, fmt, list);
|
||||
va_end (list);
|
||||
|
||||
#ifndef DEBUG
|
||||
|
@ -139,7 +141,8 @@ int log_info (const char *fmt, ...)
|
|||
do_percentm (fbuf, fmt);
|
||||
|
||||
va_start (list, fmt);
|
||||
vsnprintf (mbuf, sizeof mbuf, fbuf, list);
|
||||
fmt = fbuf;
|
||||
vsnprintf (mbuf, sizeof mbuf, fmt, list);
|
||||
va_end (list);
|
||||
|
||||
#ifndef DEBUG
|
||||
|
@ -163,7 +166,8 @@ int log_debug (const char *fmt, ...)
|
|||
do_percentm (fbuf, fmt);
|
||||
|
||||
va_start (list, fmt);
|
||||
vsnprintf (mbuf, sizeof mbuf, fbuf, list);
|
||||
fmt = fbuf;
|
||||
vsnprintf (mbuf, sizeof mbuf, fmt, list);
|
||||
va_end (list);
|
||||
|
||||
#ifndef DEBUG
|
||||
|
|
|
@ -105,9 +105,7 @@ isc_result_t omapi_protocol_connect (omapi_object_t *h,
|
|||
rstatus = ISC_R_INCOMPLETE;
|
||||
} else {
|
||||
obj -> insecure = 1;
|
||||
#if 0
|
||||
status = ISC_R_SUCCESS;
|
||||
#endif
|
||||
rstatus = ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
omapi_protocol_dereference (&obj, MDL);
|
||||
|
|
|
@ -76,6 +76,7 @@ isc_result_t omapi_init (void)
|
|||
{
|
||||
isc_result_t status;
|
||||
|
||||
#if !defined (SMALL)
|
||||
dst_init();
|
||||
|
||||
/* Register all the standard object types... */
|
||||
|
@ -104,6 +105,7 @@ isc_result_t omapi_init (void)
|
|||
0);
|
||||
if (status != ISC_R_SUCCESS)
|
||||
return status;
|
||||
#endif
|
||||
|
||||
status = omapi_object_type_register (&omapi_type_io_object,
|
||||
"io",
|
||||
|
@ -117,6 +119,7 @@ isc_result_t omapi_init (void)
|
|||
if (status != ISC_R_SUCCESS)
|
||||
return status;
|
||||
|
||||
#if !defined (SMALL)
|
||||
status = omapi_object_type_register (&omapi_type_generic,
|
||||
"generic",
|
||||
omapi_generic_set_value,
|
||||
|
@ -167,6 +170,7 @@ isc_result_t omapi_init (void)
|
|||
0);
|
||||
if (status != ISC_R_SUCCESS)
|
||||
return status;
|
||||
#endif
|
||||
|
||||
status = omapi_object_type_register (&omapi_type_waiter,
|
||||
"waiter",
|
||||
|
@ -180,6 +184,7 @@ isc_result_t omapi_init (void)
|
|||
if (status != ISC_R_SUCCESS)
|
||||
return status;
|
||||
|
||||
#if !defined (SMALL)
|
||||
status = omapi_object_type_register (&omapi_type_auth_key,
|
||||
"authenticator",
|
||||
0,
|
||||
|
@ -192,6 +197,7 @@ isc_result_t omapi_init (void)
|
|||
sizeof (omapi_auth_key_t), 0);
|
||||
if (status != ISC_R_SUCCESS)
|
||||
return status;
|
||||
#endif
|
||||
|
||||
#if defined (TRACING)
|
||||
omapi_listener_trace_setup ();
|
||||
|
|
Loading…
Reference in New Issue