2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-23 02:17:31 +00:00

Allow restricted dynamic bootp for known bootp hosts

This commit is contained in:
Ted Lemon 1996-09-12 22:22:18 +00:00
parent 62e303ddb5
commit f44c8dcbe2
2 changed files with 24 additions and 22 deletions

23
bootp.c
View File

@ -42,7 +42,7 @@
#ifndef lint
static char copyright[] =
"$Id: bootp.c,v 1.18 1996/09/11 05:50:54 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
"$Id: bootp.c,v 1.19 1996/09/12 22:22:18 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -104,6 +104,17 @@ void bootp (packet)
}
}
/* If we've been told not to boot unknown clients,
and we didn't find any host record for this client,
ignore it. */
if (!hp && !(packet -> shared_network ->
group -> boot_unknown_clients)) {
note ("Ignoring unknown BOOTP client %s",
print_hw_addr (packet -> raw -> htype,
packet -> raw -> hlen,
packet -> raw -> chaddr));
}
/* If the packet is from a host we don't know and there
are no dynamic bootp addresses on the network it came
in on, drop it on the floor. */
@ -155,16 +166,6 @@ void bootp (packet)
goto lose;
}
/* If we don't have a fixed address for it, drop it. */
if (!subnet) {
note ("No fixed address for BOOTP host %s (%s)",
print_hw_addr (packet -> raw -> htype,
packet -> raw -> hlen,
packet -> raw -> chaddr),
hp -> name);
return;
}
/* Set up the outgoing packet... */
memset (&outgoing, 0, sizeof outgoing);
memset (&raw, 0, sizeof raw);

View File

@ -42,7 +42,7 @@
#ifndef lint
static char copyright[] =
"$Id: bootp.c,v 1.18 1996/09/11 05:50:54 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
"$Id: bootp.c,v 1.19 1996/09/12 22:22:18 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -104,6 +104,17 @@ void bootp (packet)
}
}
/* If we've been told not to boot unknown clients,
and we didn't find any host record for this client,
ignore it. */
if (!hp && !(packet -> shared_network ->
group -> boot_unknown_clients)) {
note ("Ignoring unknown BOOTP client %s",
print_hw_addr (packet -> raw -> htype,
packet -> raw -> hlen,
packet -> raw -> chaddr));
}
/* If the packet is from a host we don't know and there
are no dynamic bootp addresses on the network it came
in on, drop it on the floor. */
@ -155,16 +166,6 @@ void bootp (packet)
goto lose;
}
/* If we don't have a fixed address for it, drop it. */
if (!subnet) {
note ("No fixed address for BOOTP host %s (%s)",
print_hw_addr (packet -> raw -> htype,
packet -> raw -> hlen,
packet -> raw -> chaddr),
hp -> name);
return;
}
/* Set up the outgoing packet... */
memset (&outgoing, 0, sizeof outgoing);
memset (&raw, 0, sizeof raw);