Skip to content

Commit

Permalink
[pxe] Always reconstruct packet for PXENV_GET_CACHED_INFO
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mcb30 committed Jun 29, 2015
1 parent d73982f commit edf74df
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/arch/i386/interface/pxe/pxe_preboot.c
Expand Up @@ -178,18 +178,16 @@ 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,
sizeof ( *info ) ) ) != 0 ) {
DBGC ( &pxe_netdev, " failed to build packet: %s\n",
strerror ( rc ) );
goto err;
}
/* Construct DHCP packet */
creator = &pxe_dhcp_packet_creators[idx];
if ( ( rc = creator->create ( pxe_netdev, info,
sizeof ( *info ) ) ) != 0 ) {
DBGC ( &pxe_netdev, " failed to build packet: %s\n",
strerror ( rc ) );
goto err;
}

/* Copy packet (if applicable) */
len = get_cached_info->BufferSize;
if ( len == 0 ) {
/* Point client at our cached buffer.
Expand Down

3 comments on commit edf74df

@thomas-tomlinson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this appears to cause an issue when chain loading to a microsoft WDS server. We experienced this issue as well as this forum post user: http://forum.ipxe.org/showthread.php?tid=7765 . Backing out the patch also allowed WDS to boot successfully when redirected from iPXE.

@mcb30
Copy link
Member Author

@mcb30 mcb30 commented on edf74df Aug 29, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thomas-tomlinson
Copy link

@thomas-tomlinson thomas-tomlinson commented on edf74df Aug 31, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.