mirror of https://github.com/ipxe/ipxe.git
[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
parent
d73982f098
commit
edf74df4ab
|
@ -178,8 +178,6 @@ pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO *get_cached_info ) {
|
||||||
}
|
}
|
||||||
info = &cached_info[idx];
|
info = &cached_info[idx];
|
||||||
|
|
||||||
/* Construct cached version of packet, if not already constructed. */
|
|
||||||
if ( ! info->dhcphdr.op ) {
|
|
||||||
/* Construct DHCP packet */
|
/* Construct DHCP packet */
|
||||||
creator = &pxe_dhcp_packet_creators[idx];
|
creator = &pxe_dhcp_packet_creators[idx];
|
||||||
if ( ( rc = creator->create ( pxe_netdev, info,
|
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 ) );
|
strerror ( rc ) );
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
/* Copy packet (if applicable) */
|
||||||
len = get_cached_info->BufferSize;
|
len = get_cached_info->BufferSize;
|
||||||
if ( len == 0 ) {
|
if ( len == 0 ) {
|
||||||
/* Point client at our cached buffer.
|
/* Point client at our cached buffer.
|
||||||
|
|
Loading…
Reference in New Issue