Skip to content

bootp: Fill siaddr with tftp addr if supplied as per RFC2131

Arusekk requested to merge Arusekk/libslirp:siaddr-rfc2131 into master

See #42 for context.

In order to use QEMU to try and/or debug bootstrap process with a remote TFTP server, using its built-in iPXE, there needs to be an external address supplied in the DHCP/BOOTP siaddr field (iPXE uses that for bootstrap, and pretty much ignores tftp-server-name).

iPXE's behaviour is quite correct according to the standard:

DHCP clarifies the interpretation of the 'siaddr' field as the address of the server to use in the next step of the client's bootstrap process. A DHCP server may return its own address in the 'siaddr' field, if the server is prepared to supply the next bootstrap service (e.g., delivery of an operating system executable image).

This commit makes siaddr field contain the resolved TFTP address, if it is a correct IPv4 address, and clears it otherwise. This should be correct I believe, and would allow most use cases (only changes previous behaviour if tftp-server-name is set, and in that case it has not ever worked any well I think).

---8<---

Aside from the commit, I wanted to share a not very exciting experience with fdo GitLab, because I needed to set up my own runners in order to run the CI pipeline, and the GitLab runner guide is not very helpful in setting up securely isolated docker-capable runners. So I made the gitlab/gitlab-runner image look fedora enough (adding a fake dnf command) to run the tests using a shell executor. The official tests might therefore give different results (you have been warned 😉). Maybe a guide for quick-and-dirty one-off 'just works' secure self-hosted runner setup would be beneficial? This is more of a complaint to fdo infra people than libslirp specifically, I just wanted to let it out, sorry.

Edited by Arusekk

Merge request reports