]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- Support always-broadcast flag.
authorTed Lemon <source@isc.org>
Tue, 22 Jun 1999 13:25:23 +0000 (13:25 +0000)
committerTed Lemon <source@isc.org>
Tue, 22 Jun 1999 13:25:23 +0000 (13:25 +0000)
- Fix a long-standing bug where the server would not broadcast responses
  to BOOTP clients even if asked to do so.

server/bootp.c

index 443c0a8cb214fd0d3f46ac6747d06db00138da71..329a8756e93269d669c04493f3e9b62f358f6716 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: bootp.c,v 1.47 1999/06/10 00:36:18 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: bootp.c,v 1.48 1999/06/22 13:25:23 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -208,10 +208,17 @@ void bootp (packet)
        raw.hops = packet -> raw -> hops;
        raw.xid = packet -> raw -> xid;
        raw.secs = packet -> raw -> secs;
-       raw.flags = 0;
+       raw.flags = packet -> raw -> flags;
        raw.ciaddr = packet -> raw -> ciaddr;
        memcpy (&raw.yiaddr, ip_address.iabuf, sizeof raw.yiaddr);
 
+       /* If we're always supposed to broadcast to this client, set
+          the broadcast bit in the bootp flags field. */
+       if (oc = lookup_option (&server_universe,
+                               options, SV_ALWAYS_BROADCAST) &&
+           evaluate_boolean_option_cache (packet, packet -> options, oc))
+               raw.flags |= htons (BOOTP_BROADCAST);
+
        /* Figure out the address of the next server. */
        memset (&d1, 0, sizeof d1);
        oc = lookup_option (&server_universe, options, SV_NEXT_SERVER);