mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-09-02 23:35:23 +00:00
Handle 'allow bootp' and 'allow booting' correctly. Unicast if possible.
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char copyright[] =
|
static char copyright[] =
|
||||||
"$Id: bootp.c,v 1.55 1999/10/07 06:36:29 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
|
"$Id: bootp.c,v 1.56 1999/10/20 16:47:04 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#include "dhcpd.h"
|
#include "dhcpd.h"
|
||||||
@@ -134,22 +134,19 @@ void bootp (packet)
|
|||||||
hp -> group, subnet -> group);
|
hp -> group, subnet -> group);
|
||||||
|
|
||||||
/* Drop the request if it's not allowed for this client. */
|
/* Drop the request if it's not allowed for this client. */
|
||||||
if (evaluate_boolean_option_cache (packet, lease,
|
if ((oc = lookup_option (&server_universe, options, SV_ALLOW_BOOTP)) &&
|
||||||
packet -> options, options,
|
!evaluate_boolean_option_cache (packet, lease,
|
||||||
lookup_option (&server_universe,
|
packet -> options, options, oc)) {
|
||||||
options,
|
|
||||||
SV_ALLOW_BOOTP))) {
|
|
||||||
log_info ("%s: bootp disallowed", msgbuf);
|
log_info ("%s: bootp disallowed", msgbuf);
|
||||||
option_state_dereference (&options, "bootrequest");
|
option_state_dereference (&options, "bootrequest");
|
||||||
static_lease_dereference (lease, "bootrequest");
|
static_lease_dereference (lease, "bootrequest");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (evaluate_boolean_option_cache (packet, lease,
|
if ((oc = lookup_option (&server_universe,
|
||||||
packet -> options, options,
|
options, SV_ALLOW_BOOTING)) &&
|
||||||
lookup_option (&server_universe,
|
!evaluate_boolean_option_cache (packet, lease,
|
||||||
options,
|
packet -> options, options, oc)) {
|
||||||
SV_ALLOW_BOOTING))) {
|
|
||||||
log_info ("%s: booting disallowed", msgbuf);
|
log_info ("%s: booting disallowed", msgbuf);
|
||||||
option_state_dereference (&options, "bootrequest");
|
option_state_dereference (&options, "bootrequest");
|
||||||
static_lease_dereference (lease, "bootrequest");
|
static_lease_dereference (lease, "bootrequest");
|
||||||
@@ -317,6 +314,16 @@ void bootp (packet)
|
|||||||
from, &to, &hto);
|
from, &to, &hto);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If it comes from a client that already knows its address
|
||||||
|
and is not requesting a broadcast response, and we can
|
||||||
|
unicast to a client without using the ARP protocol, sent it
|
||||||
|
directly to that client. */
|
||||||
|
} else if (!(raw.flags & htons (BOOTP_BROADCAST)) &&
|
||||||
|
can_unicast_without_arp (packet -> interface)) {
|
||||||
|
to.sin_addr = raw.yiaddr;
|
||||||
|
to.sin_port = remote_port;
|
||||||
|
|
||||||
/* Otherwise, broadcast it on the local network. */
|
/* Otherwise, broadcast it on the local network. */
|
||||||
} else {
|
} else {
|
||||||
to.sin_addr = limited_broadcast;
|
to.sin_addr = limited_broadcast;
|
||||||
|
Reference in New Issue
Block a user