Sfoglia il codice sorgente

[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>
tags/v1.20.1
Michael Brown 9 anni fa
parent
commit
edf74df4ab
1 ha cambiato i file con 8 aggiunte e 10 eliminazioni
  1. 8
    10
      src/arch/i386/interface/pxe/pxe_preboot.c

+ 8
- 10
src/arch/i386/interface/pxe/pxe_preboot.c Vedi File

@@ -178,18 +178,16 @@ pxenv_get_cached_info ( struct s_PXENV_GET_CACHED_INFO *get_cached_info ) {
178 178
 	}
179 179
 	info = &cached_info[idx];
180 180
 
181
-	/* Construct cached version of packet, if not already constructed. */
182
-	if ( ! info->dhcphdr.op ) {
183
-		/* Construct DHCP packet */
184
-		creator = &pxe_dhcp_packet_creators[idx];
185
-		if ( ( rc = creator->create ( pxe_netdev, info,
186
-					      sizeof ( *info ) ) ) != 0 ) {
187
-			DBGC ( &pxe_netdev, " failed to build packet: %s\n",
188
-			       strerror ( rc ) );
189
-			goto err;
190
-		}
181
+	/* Construct DHCP packet */
182
+	creator = &pxe_dhcp_packet_creators[idx];
183
+	if ( ( rc = creator->create ( pxe_netdev, info,
184
+				      sizeof ( *info ) ) ) != 0 ) {
185
+		DBGC ( &pxe_netdev, " failed to build packet: %s\n",
186
+		       strerror ( rc ) );
187
+		goto err;
191 188
 	}
192 189
 
190
+	/* Copy packet (if applicable) */
193 191
 	len = get_cached_info->BufferSize;
194 192
 	if ( len == 0 ) {
195 193
 		/* Point client at our cached buffer.

Loading…
Annulla
Salva