#ifndef lint
static char ocopyright[] =
-"$Id: dhclient.c,v 1.79 1999/07/06 16:48:34 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: dhclient.c,v 1.80 1999/07/31 17:50:41 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
DHO_DHCP_LEASE_TIME);
memset (&ds, 0, sizeof ds);
if (oc &&
- evaluate_option_cache (&ds, packet,
- client -> new -> options,
- (struct lease *)0, oc)) {
+ evaluate_option_cache (&ds, packet, (struct lease *)0,
+ packet -> options, client -> new -> options,
+ oc)) {
if (ds.len > 3)
client -> new -> expiry = getULong (ds.data);
else
oc = lookup_option (&dhcp_universe, client -> new -> options,
DHO_DHCP_RENEWAL_TIME);
if (oc &&
- evaluate_option_cache (&ds, packet, client -> new -> options,
- (struct lease *)0, oc)) {
+ evaluate_option_cache (&ds, packet, (struct lease *)0,
+ packet -> options, client -> new -> options,
+ oc)) {
if (ds.len > 3)
client -> new -> renewal = getULong (ds.data);
else
oc = lookup_option (&dhcp_universe, client -> new -> options,
DHO_DHCP_REBINDING_TIME);
if (oc &&
- evaluate_option_cache (&ds, packet,
- client -> new -> options,
- (struct lease *)0, oc)) {
+ evaluate_option_cache (&ds, packet, (struct lease *)0,
+ packet -> options, client -> new -> options,
+ oc)) {
if (ds.len > 3)
client -> new -> rebind = getULong (ds.data);
else
oc = lookup_option (&dhcp_universe, client -> active -> options,
DHO_DHCP_SERVER_IDENTIFIER);
if (oc &&
- evaluate_option_cache (&ds, (struct packet *)0,
+ evaluate_option_cache (&ds, (struct packet *)0, (struct lease *)0,
+ (struct option_state *)0,
client -> active -> options,
- (struct lease *)0,
oc)) {
if (ds.len > 3) {
memcpy (client -> destination.iabuf, ds.data, 4);
DHO_DHCP_OPTION_OVERLOAD);
memset (&data, 0, sizeof data);
if (oc &&
- evaluate_option_cache (&data, packet, lease -> options,
- (struct lease *)0, oc)) {
+ evaluate_option_cache (&data, packet, (struct lease *)0,
+ packet -> options, lease -> options,
+ oc)) {
if (data.len > 0)
i = data.data [0];
else
}
/* Ditto for the filename. */
- if ((i & 1) && packet -> raw -> file [0]) {
+ if (!(i & 1) && packet -> raw -> file [0]) {
int len;
/* Don't count on the NUL terminator. */
for (len = 0; len < 64; len++)
client -> packet_length =
cons_options ((struct packet *)0, &client -> packet,
(struct lease *)0, 0,
- options, 0, 0, 0, (struct data_string *)0);
+ (struct option_state *)0, options,
+ 0, 0, 0, (struct data_string *)0);
if (client -> packet_length < BOOTP_MIN_LEN)
client -> packet_length = BOOTP_MIN_LEN;
client -> packet_length =
cons_options ((struct packet *)0, &client -> packet,
(struct lease *)0, 0,
- options, 0, 0, 0, (struct data_string *)0);
+ (struct option_state *)0, options,
+ 0, 0, 0, (struct data_string *)0);
if (client -> packet_length < BOOTP_MIN_LEN)
client -> packet_length = BOOTP_MIN_LEN;
client -> packet_length =
cons_options ((struct packet *)0, &client -> packet,
(struct lease *)0, 0,
- options, 0, 0, 0, (struct data_string *)0);
+ (struct option_state *)0, options,
+ 0, 0, 0, (struct data_string *)0);
if (client -> packet_length < BOOTP_MIN_LEN)
client -> packet_length = BOOTP_MIN_LEN;
option_state_dereference (&options, "make_decline");
client -> packet_length =
cons_options ((struct packet *)0, &client -> packet,
(struct lease *)0, 0,
- options, 0, 0, 0, (struct data_string *)0);
+ (struct option_state *)0, options,
+ 0, 0, 0, (struct data_string *)0);
if (client -> packet_length < BOOTP_MIN_LEN)
client -> packet_length = BOOTP_MIN_LEN;
option_state_dereference (&options, "make_decline");
lease -> filename);
if (lease -> server_name)
fprintf (leaseFile, " server-name \"%s\";\n",
- lease -> filename);
+ lease -> server_name);
if (lease -> medium)
fprintf (leaseFile, " medium \"%s\";\n",
lease -> medium -> string);
for (p = hash [i]; p; p = p -> cdr) {
oc = (struct option_cache *)p -> car;
if (evaluate_option_cache (&ds, (struct packet *)0,
+ (struct lease *)0,
+ (struct option_state *)0,
lease -> options,
- (struct lease *)0, oc)) {
+ oc)) {
fprintf (leaseFile,
" option %s %s;\n",
oc -> option -> name,
memset (&data, 0, sizeof data);
oc = lookup_option (&dhcp_universe, lease -> options, DHO_SUBNET_MASK);
- if (oc && evaluate_option_cache (&data, (struct packet *)0,
+ if (oc && evaluate_option_cache (&data,
+ (struct packet *)0,
+ (struct lease *)0,
+ (struct option_state *)0,
lease -> options,
- (struct lease *)0, oc)) {
+ oc)) {
if (data.len > 3) {
struct iaddr netmask, subnet, broadcast;
lease -> options,
DHO_BROADCAST_ADDRESS);
if (!oc ||
- !evaluate_option_cache (&data,
- (struct packet *)0,
- lease -> options,
- (struct lease *)0,
- oc)) {
+ !(evaluate_option_cache
+ (&data, (struct packet *)0,
+ (struct lease *)0,
+ (struct option_state *)0,
+ lease -> options, oc))) {
broadcast = broadcast_addr (subnet,
netmask);
if (broadcast.len) {
for (hp = hash [i]; hp; hp = hp -> cdr) {
oc = (struct option_cache *)hp -> car;
- if (evaluate_option_cache (&data, (struct packet *)0,
+ if (evaluate_option_cache (&data,
+ (struct packet *)0,
+ (struct lease *)0,
+ (struct option_state *)0,
lease -> options,
- (struct lease *)0, oc)) {
+ oc)) {
if (data.len) {
char *s = (dhcp_option_ev_name