#ifndef lint
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 */
#include "dhcpd.h"
hp -> group, subnet -> group);
/* Drop the request if it's not allowed for this client. */
- if (evaluate_boolean_option_cache (packet, lease,
- packet -> options, options,
- lookup_option (&server_universe,
- options,
- SV_ALLOW_BOOTP))) {
+ if ((oc = lookup_option (&server_universe, options, SV_ALLOW_BOOTP)) &&
+ !evaluate_boolean_option_cache (packet, lease,
+ packet -> options, options, oc)) {
log_info ("%s: bootp disallowed", msgbuf);
option_state_dereference (&options, "bootrequest");
static_lease_dereference (lease, "bootrequest");
return;
}
- if (evaluate_boolean_option_cache (packet, lease,
- packet -> options, options,
- lookup_option (&server_universe,
- options,
- SV_ALLOW_BOOTING))) {
+ if ((oc = lookup_option (&server_universe,
+ options, SV_ALLOW_BOOTING)) &&
+ !evaluate_boolean_option_cache (packet, lease,
+ packet -> options, options, oc)) {
log_info ("%s: booting disallowed", msgbuf);
option_state_dereference (&options, "bootrequest");
static_lease_dereference (lease, "bootrequest");
from, &to, &hto);
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. */
} else {
to.sin_addr = limited_broadcast;