[cachedhcp] Include VLAN tag in filter for applying cached DHCPACK

When chainloading iPXE from a VLAN device, the MAC address within the
cached DHCPACK will match the MAC address of the trunk device created
by iPXE, and the cached DHCPACK will then end up being erroneously
applied to the trunk device.  This tends to break outbound IPv4
routing, since both the trunk and VLAN devices will have the same
assigned IPv4 address.

Fix by recording the VLAN tag along with the cached DHCPACK, and
treating the VLAN tag as part of the filter used to match the cached
DHCPACK against candidate network devices.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2022-12-22 14:59:29 +00:00
parent b9571ca12e
commit 60b5532cfc
6 changed files with 41 additions and 15 deletions

View File

@@ -18,7 +18,8 @@ extern struct cached_dhcp_packet cached_dhcpack;
extern struct cached_dhcp_packet cached_proxydhcp;
extern struct cached_dhcp_packet cached_pxebs;
extern int cachedhcp_record ( struct cached_dhcp_packet *cache, userptr_t data,
extern int cachedhcp_record ( struct cached_dhcp_packet *cache,
unsigned int vlan, userptr_t data,
size_t max_len );
#endif /* _IPXE_CACHEDHCP_H */

View File

@@ -11,6 +11,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <ipxe/efi/efi.h>
extern int efi_cachedhcp_record ( EFI_HANDLE device );
extern int efi_cachedhcp_record ( EFI_HANDLE device,
EFI_DEVICE_PATH_PROTOCOL *path );
#endif /* _IPXE_EFI_CACHEDHCP_H */