memcpy (dp + ip -> client -> config -> defaults [i].len, lease -> options [i].data, lease -> options [i].len);
void script_write_params (ip, prefix, lease)	struct interface_info *ip;	char *prefix;	struct client_lease *lease;{	int i;	u_int8_t dbuf [1500];	int len;	fprintf (scriptFile, "%sip_address=\"%s\"\n",		 prefix, piaddr (lease -> address));	fprintf (scriptFile, "export %sip_address\n", prefix);	/* For the benefit of Linux (and operating systems which may	   have similar needs), compute the network address based on	   the supplied ip address and netmask, if provided.  Also	   compute the broadcast address (the host address all ones	   broadcast address, not the host address all zeroes	   broadcast address). */	if (lease -> options [DHO_SUBNET_MASK].len &&	    (lease -> options [DHO_SUBNET_MASK].len <	     sizeof lease -> address.iabuf)) {		struct iaddr netmask, subnet, broadcast;		memcpy (netmask.iabuf,			lease -> options [DHO_SUBNET_MASK].data,			lease -> options [DHO_SUBNET_MASK].len);		netmask.len = lease -> options [DHO_SUBNET_MASK].len;		subnet = subnet_number (lease -> address, netmask);		if (subnet.len) {			fprintf (scriptFile, "%snetwork_number=\"%s\";\n",				 prefix, piaddr (subnet));			fprintf (scriptFile, "export %snetwork_number\n",				 prefix);			if (!lease -> options [DHO_BROADCAST_ADDRESS].len) {				broadcast = broadcast_addr (subnet, netmask);				if (broadcast.len) {					fprintf (scriptFile,						 "%s%s=\"%s\";\n", prefix,						 "broadcast_address",						 piaddr (broadcast));					fprintf (scriptFile,						 "export %s%s\n", prefix,						 "broadcast_address");				}			}		}	}	if (lease -> filename) {		fprintf (scriptFile, "%sfilename=\"%s\";\n",			 prefix, lease -> filename);		fprintf (scriptFile, "export %sfilename\n", prefix);	}	if (lease -> server_name) {		fprintf (scriptFile, "%sserver_name=\"%s\";\n",			 prefix, lease -> server_name);		fprintf (scriptFile, "export %sserver_name\n", prefix);	}	for (i = 0; i < 256; i++) {		u_int8_t *dp;		if (ip -> client -> config -> defaults [i].len) {			if (lease -> options [i].len) {				switch (ip -> client ->					config -> default_actions [i]) {				      case ACTION_DEFAULT:					dp = lease -> options [i].data;					len = lease -> options [i].len;					break;				      case ACTION_SUPERSEDE:				      supersede:					dp = ip -> client ->						config -> defaults [i].data;					len = ip -> client ->						config -> defaults [i].len;					break;				      case ACTION_PREPEND:					len = (ip -> client ->					       config -> defaults [i].len +					       lease -> options [i].len);					if (len > sizeof dbuf) {						warn ("no space to %s %s",						      "prepend option",						      dhcp_options [i].name);						goto supersede;					}					dp = dbuf;					memcpy (dp,						ip -> client -> 						config -> defaults [i].data,						ip -> client -> 						config -> defaults [i].len);					memcpy (dp + ip -> client -> 						config -> defaults [i].len,						lease -> options [i].data,						lease -> options [i].len);					break;				      case ACTION_APPEND:					len = (ip -> client ->					       config -> defaults [i].len +					       lease -> options [i].len);					if (len > sizeof dbuf) {						warn ("no space to %s %s",						      "append option",						      dhcp_options [i].name);						goto supersede;					}					dp = dbuf;					memcpy (dp,						ip -> client -> 						config -> defaults [i].data,						ip -> client -> 						config -> defaults [i].len);					memcpy (dp + ip -> client -> 						config -> defaults [i].len,						lease -> options [i].data,						lease -> options [i].len);				}			} else {				dp = ip -> client ->					config -> defaults [i].data;				len = ip -> client ->					config -> defaults [i].len;			}		} else if (lease -> options [i].len) {			len = lease -> options [i].len;			dp = lease -> options [i].data;		} else {			len = 0;		}		if (len) {			char *s = dhcp_option_ev_name (&dhcp_options [i]);							fprintf (scriptFile, "%s%s=\"%s\"\n", prefix, s,				 pretty_print_option (i, dp, len, 0, 0));			fprintf (scriptFile, "export %s%s\n", prefix, s);		}	}	fprintf (scriptFile, "%sexpiry=\"%d\"\n",		 prefix, (int)lease -> expiry); /* XXX */	fprintf (scriptFile, "export %sexpiry\n", prefix);}