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 <dave@natulte.net>
This commit is contained in:
David Anderson 2024-05-31 15:59:07 -07:00
parent 64f6de6d0e
commit 9e897ef112
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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]