Fix dhcp-hostsfile to explicitly set known tag for PXE clients
build-and-push / test (push) Successful in 37s
build-and-push / build-and-push (push) Successful in 1m34s

Bare MACs in dhcp-hostsfile were not auto-setting the known tag in
proxy DHCP mode, causing dhcp-ignore=tag:!known to drop all requests.
Explicitly write set:known per host entry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-13 22:08:48 -04:00
parent ba5440a481
commit dfcf91c949
+3 -3
View File
@@ -79,11 +79,11 @@ func (s *Supervisor) writeConfig(hosts []model.Host) error {
confPath := filepath.Join(s.cfg.RuntimeDir, "dnsmasq.conf")
hostsPath := filepath.Join(s.cfg.RuntimeDir, "dhcp-hostsfile")
var macs []string
var lines []string
for _, h := range hosts {
macs = append(macs, h.MAC)
lines = append(lines, h.MAC+",set:known")
}
if err := os.WriteFile(hostsPath, []byte(strings.Join(macs, "\n")+"\n"), 0o644); err != nil {
if err := os.WriteFile(hostsPath, []byte(strings.Join(lines, "\n")+"\n"), 0o644); err != nil {
return fmt.Errorf("pxe: write dhcp-hostsfile: %w", err)
}