mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-24 10:58:13 +00:00
Allow restricted dynamic bootp for known bootp hosts
This commit is contained in:
parent
62e303ddb5
commit
f44c8dcbe2
23
bootp.c
23
bootp.c
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
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 */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#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
|
/* If the packet is from a host we don't know and there
|
||||||
are no dynamic bootp addresses on the network it came
|
are no dynamic bootp addresses on the network it came
|
||||||
in on, drop it on the floor. */
|
in on, drop it on the floor. */
|
||||||
@ -155,16 +166,6 @@ void bootp (packet)
|
|||||||
goto lose;
|
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... */
|
/* Set up the outgoing packet... */
|
||||||
memset (&outgoing, 0, sizeof outgoing);
|
memset (&outgoing, 0, sizeof outgoing);
|
||||||
memset (&raw, 0, sizeof raw);
|
memset (&raw, 0, sizeof raw);
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
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 */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#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
|
/* If the packet is from a host we don't know and there
|
||||||
are no dynamic bootp addresses on the network it came
|
are no dynamic bootp addresses on the network it came
|
||||||
in on, drop it on the floor. */
|
in on, drop it on the floor. */
|
||||||
@ -155,16 +166,6 @@ void bootp (packet)
|
|||||||
goto lose;
|
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... */
|
/* Set up the outgoing packet... */
|
||||||
memset (&outgoing, 0, sizeof outgoing);
|
memset (&outgoing, 0, sizeof outgoing);
|
||||||
memset (&raw, 0, sizeof raw);
|
memset (&raw, 0, sizeof raw);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user