[pxe] Always reconstruct packet for PXENV_GET_CACHED_INFO

Avoid accidentally returning stale packets (e.g. for a previously
attempted network device) by always constructing a fresh DHCP packet.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
pull/38/head
Michael Brown 2015-06-29 09:58:16 +01:00
parent d73982f098
commit edf74df4ab
1 changed files with 8 additions and 10 deletions

View File

@ -178,8 +178,6 @@ pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO *get_cached_info ) {
}
info = &cached_info[idx];
/* Construct cached version of packet, if not already constructed. */
if ( ! info->dhcphdr.op ) {
/* Construct DHCP packet */
creator = &pxe_dhcp_packet_creators[idx];
if ( ( rc = creator->create ( pxe_netdev, info,
@ -188,8 +186,8 @@ pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO *get_cached_info ) {
strerror ( rc ) );
goto err;
}
}
/* Copy packet (if applicable) */
len = get_cached_info->BufferSize;
if ( len == 0 ) {
/* Point client at our cached buffer.