mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-31 06:15:55 +00:00
Allow unnamed host declarations.
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"$Id: bootp.c,v 1.29 1998/02/06 01:05:39 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||
"$Id: bootp.c,v 1.30 1998/03/17 06:18:06 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "dhcpd.h"
|
||||
@@ -110,13 +110,21 @@ void bootp (packet)
|
||||
|
||||
if (host && (!host -> group -> allow_booting)) {
|
||||
note ("Ignoring excluded BOOTP client %s",
|
||||
host -> name);
|
||||
host -> name
|
||||
? host -> name
|
||||
: print_hw_addr (packet -> raw -> htype,
|
||||
packet -> raw -> hlen,
|
||||
packet -> raw -> chaddr));
|
||||
return;
|
||||
}
|
||||
|
||||
if (host && (!host -> group -> allow_bootp)) {
|
||||
note ("Ignoring BOOTP request from client %s",
|
||||
host -> name);
|
||||
host -> name
|
||||
? host -> name
|
||||
: print_hw_addr (packet -> raw -> htype,
|
||||
packet -> raw -> hlen,
|
||||
packet -> raw -> chaddr));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -42,7 +42,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"$Id: confpars.c,v 1.47 1998/03/16 06:17:37 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||
"$Id: confpars.c,v 1.48 1998/03/17 06:18:58 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "dhcpd.h"
|
||||
@@ -485,11 +485,17 @@ void parse_host_declaration (cfile, group)
|
||||
char *val;
|
||||
int token;
|
||||
struct host_decl *host;
|
||||
char *name = parse_host_name (cfile);
|
||||
char *name;
|
||||
int declaration = 0;
|
||||
|
||||
if (!name)
|
||||
return;
|
||||
token = peek_token (&val, cfile);
|
||||
if (token != LBRACE) {
|
||||
name = parse_host_name (cfile);
|
||||
if (!name)
|
||||
return;
|
||||
} else {
|
||||
name = (char *)0;
|
||||
}
|
||||
|
||||
host = (struct host_decl *)dmalloc (sizeof (struct host_decl),
|
||||
"parse_host_declaration");
|
||||
|
@@ -42,7 +42,7 @@
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"$Id: dhcp.c,v 1.59 1998/03/16 06:18:03 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||
"$Id: dhcp.c,v 1.60 1998/03/17 06:20:51 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "dhcpd.h"
|
||||
@@ -153,7 +153,11 @@ void dhcpdiscover (packet)
|
||||
} else if (lease -> host &&
|
||||
!lease -> host -> group -> allow_booting) {
|
||||
note ("Declining to boot client %s",
|
||||
lease -> host -> name);
|
||||
lease -> host -> name
|
||||
? lease -> host -> name
|
||||
: print_hw_addr (packet -> raw -> htype,
|
||||
packet -> raw -> hlen,
|
||||
packet -> raw -> chaddr));
|
||||
} else
|
||||
ack_lease (packet, lease, DHCPOFFER, cur_time + 120);
|
||||
}
|
||||
@@ -1280,11 +1284,12 @@ struct lease *find_lease (packet, share, ours)
|
||||
ip_lease -> uid_len == packet -> options [i].len &&
|
||||
!memcmp (packet -> options [i].data,
|
||||
ip_lease -> uid, ip_lease -> uid_len)) {
|
||||
warn ("client %s has duplicate leases on %s",
|
||||
print_hw_addr (packet -> raw -> htype,
|
||||
packet -> raw -> hlen,
|
||||
packet -> raw -> chaddr),
|
||||
ip_lease -> shared_network -> name);
|
||||
if (uid_lease -> ends > cur_time)
|
||||
warn ("client %s has duplicate leases on %s",
|
||||
print_hw_addr (packet -> raw -> htype,
|
||||
packet -> raw -> hlen,
|
||||
packet -> raw -> chaddr),
|
||||
ip_lease -> shared_network -> name);
|
||||
uid_lease = ip_lease;
|
||||
}
|
||||
ip_lease = (struct lease *)0;
|
||||
|
Reference in New Issue
Block a user