|
@@ -138,12 +138,15 @@ find_dhcp_packet_field ( unsigned int tag ) {
|
138
|
138
|
int dhcppkt_store ( struct dhcp_packet *dhcppkt, unsigned int tag,
|
139
|
139
|
const void *data, size_t len ) {
|
140
|
140
|
struct dhcp_packet_field *field;
|
|
141
|
+ void *field_data;
|
141
|
142
|
int rc;
|
142
|
143
|
|
143
|
144
|
/* If this is a special field, fill it in */
|
144
|
145
|
if ( ( field = find_dhcp_packet_field ( tag ) ) != NULL ) {
|
145
|
146
|
if ( len > field->len )
|
146
|
147
|
return -ENOSPC;
|
|
148
|
+ field_data = dhcp_packet_field ( dhcppkt->dhcphdr, field );
|
|
149
|
+ memset ( field_data, 0, field->len );
|
147
|
150
|
memcpy ( dhcp_packet_field ( dhcppkt->dhcphdr, field ),
|
148
|
151
|
data, len );
|
149
|
152
|
return 0;
|