From 9e897ef11210da93a3d82fed49efd136c5bb2daf Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 31 May 2024 15:59:07 -0700 Subject: [PATCH] pixiecore: fix the unknown firmware type error in DHCP and PXE. The error message accidentally used the retval instead of the packet's value, so always returned type 0 (x86 PC, the most universal firmware type) instead of the actual unsupported type. Signed-off-by: David Anderson --- pixiecore/dhcp.go | 2 +- pixiecore/pxe.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pixiecore/dhcp.go b/pixiecore/dhcp.go index fdfe3af..42fc85c 100644 --- a/pixiecore/dhcp.go +++ b/pixiecore/dhcp.go @@ -116,7 +116,7 @@ func (s *Server) validateDHCP(pkt *dhcp4.Packet) (mach Machine, fwtype Firmware, mach.Arch = ArchX64 fwtype = FirmwareEFIBC default: - return mach, 0, fmt.Errorf("unsupported client firmware type '%d' (please file a bug!)", fwtype) + return mach, 0, fmt.Errorf("unsupported client firmware type '%d' (please file a bug!)", fwt) } // Now, identify special sub-breeds of client firmware based on diff --git a/pixiecore/pxe.go b/pixiecore/pxe.go index 01c5d3a..6ae1589 100644 --- a/pixiecore/pxe.go +++ b/pixiecore/pxe.go @@ -107,7 +107,7 @@ func (s *Server) validatePXE(pkt *dhcp4.Packet) (fwtype Firmware, err error) { return 0, fmt.Errorf("unsupported client firmware type '%d' (please file a bug!)", fwt) } if s.Ipxe[fwtype] == nil { - return 0, fmt.Errorf("unsupported client firmware type '%d' (please file a bug!)", fwtype) + return 0, fmt.Errorf("unsupported client firmware type '%d' (please file a bug!)", fwt) } guid := pkt.Options[97]