diff options
author | Ted Lemon <source@isc.org> | 2000-10-13 18:58:12 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 2000-10-13 18:58:12 +0000 |
commit | bca944231b33a5420fbcacf0339b21190af700b2 (patch) | |
tree | 742a922cdaf080dd90877b8a7ad98ad451ded27a | |
parent | b0fff90afc28cd70c3172b640ce523fc71606b13 (diff) | |
download | isc-dhcp-bca944231b33a5420fbcacf0339b21190af700b2.tar.gz |
Disable unicast broadcast hack, but leave a place for it to be configured.
-rw-r--r-- | includes/dhcpd.h | 4 | ||||
-rw-r--r-- | server/dhcp.c | 11 |
2 files changed, 11 insertions, 4 deletions
diff --git a/includes/dhcpd.h b/includes/dhcpd.h index 37335cf7..2b5e7b81 100644 --- a/includes/dhcpd.h +++ b/includes/dhcpd.h @@ -276,7 +276,9 @@ struct lease { # define MS_NULL_TERMINATION 8 # define ON_UPDATE_QUEUE 16 # define ON_ACK_QUEUE 32 -# define EPHEMERAL_FLAGS (MS_NULL_TERMINATION) +# define UNICAST_BROADCAST_HACK 64 +# define EPHEMERAL_FLAGS (MS_NULL_TERMINATION | \ + UNICAST_BROADCAST_HACK) binding_state_t binding_state; /* See failover.h, FTS_*. */ binding_state_t next_binding_state; /* See failover.h, FTS_*. */ diff --git a/server/dhcp.c b/server/dhcp.c index a078694f..e2273d46 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -43,7 +43,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.168 2000/10/10 23:07:24 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.169 2000/10/13 18:58:12 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -1091,10 +1091,12 @@ void nak_lease (packet, cip) dump_raw ((unsigned char *)&raw, outgoing.packet_length); #endif +#if 0 hto.hbuf [0] = packet -> raw -> htype; hto.hlen = packet -> raw -> hlen; memcpy (&hto.hbuf [1], packet -> raw -> chaddr, hto.hlen); hto.hlen++; +#endif /* Set up the common stuff... */ to.sin_family = AF_INET; @@ -2170,7 +2172,7 @@ void dhcp_reply (lease) int result; int i; struct lease_state *state = lease -> state; - int nulltp, bootpp; + int nulltp, bootpp, unicastp = 1; struct option_tag *ot, *not; struct data_string d1; struct option_cache *oc; @@ -2354,13 +2356,16 @@ void dhcp_reply (lease) } else { to.sin_addr = limited_broadcast; to.sin_port = remote_port; + if (!(lease -> flags & UNICAST_BROADCAST_HACK)) + unicastp = 0; } memcpy (&from, state -> from.iabuf, sizeof from); result = send_packet (state -> ip, (struct packet *)0, &raw, packet_length, - from, &to, &hto); + from, &to, + unicastp ? &hto : (struct hardware *)0); /* Free all of the entries in the option_state structure now that we're done with them. */ |