Patchlevel 25
This commit is contained in:
parent
f262e02775
commit
95518966c2
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: conflex.c,v 1.1.1.5 1999/02/18 21:48:49 mellon Exp $ Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: conflex.c,v 1.1.1.6 1999/04/09 17:52:05 mellon Exp $ Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
|
@ -354,6 +354,8 @@ static int intern (atom, dfv)
|
||||||
|
|
||||||
switch (tolower (atom [0])) {
|
switch (tolower (atom [0])) {
|
||||||
case 'a':
|
case 'a':
|
||||||
|
if (!strcasecmp (atom + 1, "lways-reply-rfc1048"))
|
||||||
|
return ALWAYS_REPLY_RFC1048;
|
||||||
if (!strcasecmp (atom + 1, "ppend"))
|
if (!strcasecmp (atom + 1, "ppend"))
|
||||||
return APPEND;
|
return APPEND;
|
||||||
if (!strcasecmp (atom + 1, "llow"))
|
if (!strcasecmp (atom + 1, "llow"))
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: hash.c,v 1.1.1.2 1999/02/18 21:48:50 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: hash.c,v 1.1.1.3 1999/04/09 17:52:05 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
|
@ -67,23 +67,12 @@ static INLINE int do_hash (name, len, size)
|
||||||
register int accum = 0;
|
register int accum = 0;
|
||||||
register unsigned char *s = name;
|
register unsigned char *s = name;
|
||||||
int i = len;
|
int i = len;
|
||||||
if (i) {
|
while (i--) {
|
||||||
while (i--) {
|
/* Add the character in... */
|
||||||
/* Add the character in... */
|
accum += *s++;
|
||||||
accum += *s++;
|
/* Add carry back in... */
|
||||||
/* Add carry back in... */
|
while (accum > 255) {
|
||||||
while (accum > 255) {
|
accum = (accum & 255) + (accum >> 8);
|
||||||
accum = (accum & 255) + (accum >> 8);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
while (*s) {
|
|
||||||
/* Add the character in... */
|
|
||||||
accum += *s++;
|
|
||||||
/* Add carry back in... */
|
|
||||||
while (accum > 255) {
|
|
||||||
accum = (accum & 255) + (accum >> 8);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return accum % size;
|
return accum % size;
|
||||||
|
@ -100,6 +89,8 @@ void add_hash (table, name, len, pointer)
|
||||||
|
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
if (!len)
|
||||||
|
len = strlen ((char *)name);
|
||||||
|
|
||||||
hashno = do_hash (name, len, table -> hash_count);
|
hashno = do_hash (name, len, table -> hash_count);
|
||||||
bp = new_hash_bucket ("add_hash");
|
bp = new_hash_bucket ("add_hash");
|
||||||
|
@ -125,6 +116,8 @@ void delete_hash_entry (table, name, len)
|
||||||
|
|
||||||
if (!table)
|
if (!table)
|
||||||
return;
|
return;
|
||||||
|
if (!len)
|
||||||
|
len = strlen ((char *)name);
|
||||||
|
|
||||||
hashno = do_hash (name, len, table -> hash_count);
|
hashno = do_hash (name, len, table -> hash_count);
|
||||||
|
|
||||||
|
@ -157,19 +150,15 @@ unsigned char *hash_lookup (table, name, len)
|
||||||
|
|
||||||
if (!table)
|
if (!table)
|
||||||
return (unsigned char *)0;
|
return (unsigned char *)0;
|
||||||
|
|
||||||
|
if (!len)
|
||||||
|
len = strlen ((char *)name);
|
||||||
|
|
||||||
hashno = do_hash (name, len, table -> hash_count);
|
hashno = do_hash (name, len, table -> hash_count);
|
||||||
|
|
||||||
if (len) {
|
for (bp = table -> buckets [hashno]; bp; bp = bp -> next) {
|
||||||
for (bp = table -> buckets [hashno]; bp; bp = bp -> next) {
|
if (len == bp -> len && !memcmp (bp -> name, name, len))
|
||||||
if (len == bp -> len
|
return bp -> value;
|
||||||
&& !memcmp (bp -> name, name, len))
|
|
||||||
return bp -> value;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (bp = table -> buckets [hashno]; bp; bp = bp -> next)
|
|
||||||
if (!strcmp ((char *)bp -> name, (char *)name))
|
|
||||||
return bp -> value;
|
|
||||||
}
|
}
|
||||||
return (unsigned char *)0;
|
return (unsigned char *)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: raw.c,v 1.1.1.3 1999/02/24 04:11:03 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1999 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: raw.c,v 1.1.1.4 1999/04/09 17:52:06 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1999 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
|
@ -81,6 +81,7 @@ void if_register_send (info)
|
||||||
if (!quiet_interface_discovery)
|
if (!quiet_interface_discovery)
|
||||||
note ("Sending on %s, port %d",
|
note ("Sending on %s, port %d",
|
||||||
piaddr (info -> address), htons (local_port));
|
piaddr (info -> address), htons (local_port));
|
||||||
|
|
||||||
if ((sock = socket (AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0)
|
if ((sock = socket (AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0)
|
||||||
error ("Can't create dhcp socket: %m");
|
error ("Can't create dhcp socket: %m");
|
||||||
|
|
||||||
|
@ -104,7 +105,7 @@ void if_register_send (info)
|
||||||
info -> shared_network -> name : ""));
|
info -> shared_network -> name : ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t send_packet (interface, packet, raw, len, from, to, hto)
|
ssize_t send_packet (interface, packet, raw, len, from, to, hto)
|
||||||
struct interface_info *interface;
|
struct interface_info *interface;
|
||||||
struct packet *packet;
|
struct packet *packet;
|
||||||
struct dhcp_packet *raw;
|
struct dhcp_packet *raw;
|
||||||
|
@ -113,7 +114,7 @@ size_t send_packet (interface, packet, raw, len, from, to, hto)
|
||||||
struct sockaddr_in *to;
|
struct sockaddr_in *to;
|
||||||
struct hardware *hto;
|
struct hardware *hto;
|
||||||
{
|
{
|
||||||
unsigned char buf [256];
|
unsigned char buf [1500];
|
||||||
int bufp = 0;
|
int bufp = 0;
|
||||||
struct iovec iov [2];
|
struct iovec iov [2];
|
||||||
int result;
|
int result;
|
||||||
|
@ -122,16 +123,31 @@ size_t send_packet (interface, packet, raw, len, from, to, hto)
|
||||||
assemble_udp_ip_header (interface, buf, &bufp, from.s_addr,
|
assemble_udp_ip_header (interface, buf, &bufp, from.s_addr,
|
||||||
to -> sin_addr.s_addr, to -> sin_port,
|
to -> sin_addr.s_addr, to -> sin_port,
|
||||||
(unsigned char *)raw, len);
|
(unsigned char *)raw, len);
|
||||||
|
if (len + bufp > sizeof buf) {
|
||||||
/* Fire it off */
|
warn ("send_packet: packet too large (%s)", len + bufp);
|
||||||
iov [0].iov_base = (char *)buf;
|
return;
|
||||||
iov [0].iov_len = bufp;
|
}
|
||||||
iov [1].iov_base = (char *)raw;
|
memcpy (buf + bufp, raw, len);
|
||||||
iov [1].iov_len = len;
|
bufp += len;
|
||||||
|
result = sendto (interface -> wfdesc, (char *)buf, bufp, 0,
|
||||||
result = writev(interface -> wfdesc, iov, 2);
|
(struct sockaddr *)to, sizeof *to);
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
warn ("send_packet: %m");
|
warn ("send_packet: %m");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif /* USE_SOCKET_SEND */
|
|
||||||
|
int can_unicast_without_arp ()
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void maybe_setup_fallback ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void if_reinitialize_send (info)
|
||||||
|
struct interface_info *info;
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* USE_RAW_SEND */
|
||||||
|
|
|
@ -0,0 +1,93 @@
|
||||||
|
/* irix.h */
|
||||||
|
/*
|
||||||
|
* Copyright (c) 1996 The Internet Software Consortium. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. Neither the name of The Internet Software Consortium nor the names of its
|
||||||
|
* contributors may be used to endorse or promote products derived
|
||||||
|
* from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE INTERNET SOFTWARE CONSORTIUM AND
|
||||||
|
* CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||||
|
* INTERNET SOFTWARE CONSORTIUM OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||||
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||||
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define int8_t char
|
||||||
|
#define int16_t short
|
||||||
|
#define int32_t long
|
||||||
|
|
||||||
|
#define u_int8_t unsigned char
|
||||||
|
#define u_int16_t unsigned short
|
||||||
|
#define u_int32_t unsigned long
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include <syslog.h>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <setjmp.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include <net/if_dl.h>
|
||||||
|
|
||||||
|
extern int h_errno;
|
||||||
|
|
||||||
|
#include <net/if.h>
|
||||||
|
#include <net/if_arp.h>
|
||||||
|
|
||||||
|
#define _PATH_DHCPD_CONF "/usr/local/etc/dhcpd.conf"
|
||||||
|
#define _PATH_DHCPD_DB "/usr/local/etc/dhcp/dhcpd.leases"
|
||||||
|
|
||||||
|
#ifndef _PATH_DHCPD_PID
|
||||||
|
#define _PATH_DHCPD_PID "/etc/dhcpd.pid"
|
||||||
|
#endif
|
||||||
|
#ifndef _PATH_DHCLIENT_PID
|
||||||
|
#define _PATH_DHCLIENT_PID "/etc/dhclient.pid"
|
||||||
|
#endif
|
||||||
|
#ifndef _PATH_DHCRELAY_PID
|
||||||
|
#define _PATH_DHCRELAY_PID "/etc/dhcrelay.pid"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
#define VA_DOTDOTDOT ...
|
||||||
|
#define VA_start(list, last) va_start (list, last)
|
||||||
|
#define va_dcl
|
||||||
|
|
||||||
|
#define vsnprintf(buf, size, fmt, list) vsprintf (buf, fmt, list)
|
||||||
|
#define NO_SNPRINTF
|
||||||
|
|
||||||
|
#if defined (USE_DEFAULT_NETWORK)
|
||||||
|
# define USE_RAW_SEND
|
||||||
|
# define USE_SOCKET_RECEIVE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define EOL '\n'
|
||||||
|
#define VOIDPTR void *
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
#define TIME time_t
|
||||||
|
#define GET_TIME(x) time ((x))
|
||||||
|
|
||||||
|
#define random rand
|
|
@ -128,6 +128,7 @@
|
||||||
#define USE_LEASE_ADDR_FOR_DEFAULT_ROUTE 332
|
#define USE_LEASE_ADDR_FOR_DEFAULT_ROUTE 332
|
||||||
#define AUTHORITATIVE 333
|
#define AUTHORITATIVE 333
|
||||||
#define TOKEN_NOT 334
|
#define TOKEN_NOT 334
|
||||||
|
#define ALWAYS_REPLY_RFC1048 335
|
||||||
|
|
||||||
#define is_identifier(x) ((x) >= FIRST_TOKEN && \
|
#define is_identifier(x) ((x) >= FIRST_TOKEN && \
|
||||||
(x) != STRING && \
|
(x) != STRING && \
|
||||||
|
|
|
@ -127,6 +127,10 @@
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(IRIX) || defined(__sgi)
|
||||||
|
# include "cf/irix.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined (TIME_MAX)
|
#if !defined (TIME_MAX)
|
||||||
# define TIME_MAX 2147483647
|
# define TIME_MAX 2147483647
|
||||||
#endif
|
#endif
|
||||||
|
@ -286,4 +290,3 @@
|
||||||
#if defined (AF_LINK) && !defined (HAVE_AF_LINK)
|
#if defined (AF_LINK) && !defined (HAVE_AF_LINK)
|
||||||
# define HAVE_AF_LINK
|
# define HAVE_AF_LINK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char ocopyright [] =
|
static char ocopyright [] =
|
||||||
"$Id: dhcrelay.c,v 1.1.1.12 1999/03/30 03:10:49 mellon Exp $ Copyright (c) 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: dhcrelay.c,v 1.1.1.13 1999/04/09 17:52:09 mellon Exp $ Copyright (c) 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
|
@ -76,7 +76,7 @@ struct server_list {
|
||||||
static char copyright [] =
|
static char copyright [] =
|
||||||
"Copyright 1997, 1998, 1999 The Internet Software Consortium.";
|
"Copyright 1997, 1998, 1999 The Internet Software Consortium.";
|
||||||
static char arr [] = "All rights reserved.";
|
static char arr [] = "All rights reserved.";
|
||||||
static char message [] = "Internet Software Consortium DHCP Relay Agent V2.0b1pl22";
|
static char message [] = "Internet Software Consortium DHCP Relay Agent V2.0b1pl25";
|
||||||
static char contrib [] = "Please contribute if you find this software useful.";
|
static char contrib [] = "Please contribute if you find this software useful.";
|
||||||
static char url [] = "For info, please visit http://www.isc.org/dhcp-contrib.html";
|
static char url [] = "For info, please visit http://www.isc.org/dhcp-contrib.html";
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: confpars.c,v 1.1.1.7 1999/03/29 23:00:56 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: confpars.c,v 1.1.1.8 1999/04/09 17:52:09 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
|
@ -310,6 +310,10 @@ int parse_statement (cfile, group, type, host_decl, declaration)
|
||||||
group -> get_lease_hostnames = parse_boolean (cfile);
|
group -> get_lease_hostnames = parse_boolean (cfile);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ALWAYS_REPLY_RFC1048:
|
||||||
|
group -> always_reply_rfc1048 = parse_boolean (cfile);
|
||||||
|
break;
|
||||||
|
|
||||||
case USE_HOST_DECL_NAMES:
|
case USE_HOST_DECL_NAMES:
|
||||||
if (type == HOST_DECL)
|
if (type == HOST_DECL)
|
||||||
parse_warn ("use-host-decl-names not allowed here.");
|
parse_warn ("use-host-decl-names not allowed here.");
|
||||||
|
|
Loading…
Reference in New Issue