Skip to content

Commit

Permalink
fix(coresmd): always terminate packet when IP assigned
Browse files Browse the repository at this point in the history
  • Loading branch information
synackd committed Oct 23, 2024
1 parent 8e1c6b4 commit d31b53a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions coresmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,19 @@ func Handler4(req, resp *dhcpv4.DHCPv4) (*dhcpv4.DHCPv4, bool) {
}

// STEP 2: Send boot config
var terminate bool
if cinfo := req.Options.Get(dhcpv4.OptionUserClassInformation); string(cinfo) != "iPXE" {
// BOOT STAGE 1: Send iPXE bootloader over TFTP
resp, terminate = ipxe.ServeIPXEBootloader(log, req, resp)
resp, _ = ipxe.ServeIPXEBootloader(log, req, resp)
} else {
// BOOT STAGE 2: Send URL to BSS boot script
bssURL := bootScriptBaseURL.JoinPath("/boot/v1/bootscript")
bssURL.RawQuery = fmt.Sprintf("mac=%s", hwAddr)
resp.Options.Update(dhcpv4.OptBootFileName(bssURL.String()))
terminate = true
}

debug.DebugResponse(log, resp)

return resp, terminate
return resp, true
}

func lookupMAC(mac string) (IfaceInfo, error) {
Expand Down

0 comments on commit d31b53a

Please sign in to comment.