diff options
author | Ted Lemon <source@isc.org> | 1999-03-30 00:26:11 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 1999-03-30 00:26:11 +0000 |
commit | 490b14eec3fab5eeab1f95c21c4432c589066b1a (patch) | |
tree | 2e7041b1fb672b5bb4635f438d441681b5176ef0 | |
parent | 08749b7cdea4ae82ab6ee25930efc153adc91086 (diff) | |
download | isc-dhcp-490b14eec3fab5eeab1f95c21c4432c589066b1a.tar.gz |
Fix up code to set bootp flags.
-rw-r--r-- | client/dhclient.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/client/dhclient.c b/client/dhclient.c index c672ed01..7e8f8ebd 100644 --- a/client/dhclient.c +++ b/client/dhclient.c @@ -56,7 +56,7 @@ #ifndef lint static char ocopyright[] = -"$Id: dhclient.c,v 1.44.2.29 1999/03/29 23:13:48 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhclient.c,v 1.44.2.30 1999/03/30 00:26:11 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -1456,7 +1456,12 @@ void make_discover (ip, lease) ip -> client -> packet.hops = 0; ip -> client -> packet.xid = random (); ip -> client -> packet.secs = 0; /* filled in by send_discover. */ - ip -> client -> packet.flags = htons (BOOTP_BROADCAST); /* XXX */ + + if (can_receive_unicast_unconfigured (ip)) + ip -> client -> packet.flags = 0; + else + ip -> client -> packet.flags = htons (BOOTP_BROADCAST); + memset (&(ip -> client -> packet.ciaddr), 0, sizeof ip -> client -> packet.ciaddr); memset (&(ip -> client -> packet.yiaddr), @@ -1575,7 +1580,10 @@ void make_request (ip, lease) } else { memset (&ip -> client -> packet.ciaddr, 0, sizeof ip -> client -> packet.ciaddr); - ip -> client -> packet.flags = htons (BOOTP_BROADCAST); + if (can_receive_unicast_unconfigured (ip)) + ip -> client -> packet.flags = 0; + else + ip -> client -> packet.flags = htons (BOOTP_BROADCAST); } memset (&ip -> client -> packet.yiaddr, 0, @@ -1664,7 +1672,7 @@ void make_decline (ip, lease) ip -> client -> packet.hops = 0; ip -> client -> packet.xid = ip -> client -> xid; ip -> client -> packet.secs = 0; /* Filled in by send_request. */ - ip -> client -> packet.flags = htons (BOOTP_BROADCAST); + ip -> client -> packet.flags = 0; /* ciaddr must always be zero. */ memset (&ip -> client -> packet.ciaddr, 0, @@ -1730,8 +1738,9 @@ void make_release (ip, lease) ip -> client -> packet.xid = random (); ip -> client -> packet.secs = 0; ip -> client -> packet.flags = 0; - memcpy (&ip -> client -> packet.ciaddr, - lease -> address.iabuf, lease -> address.len); + + memset (&ip -> client -> packet.ciaddr, 0, + sizeof ip -> client -> packet.ciaddr); memset (&ip -> client -> packet.yiaddr, 0, sizeof ip -> client -> packet.yiaddr); memset (&ip -> client -> packet.siaddr, 0, |