From: Ted Lemon Date: Tue, 22 Jun 1999 13:25:23 +0000 (+0000) Subject: - Support always-broadcast flag. X-Git-Tag: V3-BETA-1-PATCH-0~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9129caed21edb8c49c9567f7f211c1cc3d546123;p=thirdparty%2Fdhcp.git - Support always-broadcast flag. - Fix a long-standing bug where the server would not broadcast responses to BOOTP clients even if asked to do so. --- diff --git a/server/bootp.c b/server/bootp.c index 443c0a8cb..329a8756e 100644 --- a/server/bootp.c +++ b/server/bootp.c @@ -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);