🐛 Fix DHCPv6 PXE boot: use option6:61 for arch detection#917
🐛 Fix DHCPv6 PXE boot: use option6:61 for arch detection#917metal3-io-bot merged 2 commits intometal3-io:mainfrom
Conversation
|
Hi @holmboe. Thanks for your PR. I'm waiting for a metal3-io member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
The IPv6 section of the dnsmasq template used option:client-arch to match client architecture, but this is a DHCPv4-only alias (option 93). In dnsmasq, the "option:" prefix resolves via the DHCPv4 option table (opttab) and the resulting match rule is added to daemon->dhcp_match, which is never evaluated by the DHCPv6 server code (rfc3315.c only iterates daemon->dhcp_match6). The directives were silently ignored. The fix uses option6:client-arch, which correctly resolves to DHCPv6 option 61 (Client System Architecture Type, RFC 5970). Both EDK2/OVMF and iPXE send this option in DHCPv6 SOLICIT messages. Note: option6:client-arch requires dnsmasq to have option 61 in its DHCPv6 option table (opttab6). Upstream dnsmasq is missing this entry, but Red Hat has carried a downstream patch adding it since 2021 (dnsmasq-2.86-dhcpv6-client-arch.patch), which is included in the CentOS Stream 9 base image used by this container. Also replaces the impossible BIOS fallback (undionly.kpxe over IPv6) with an x86_64 EFI fallback for PXE clients whose architecture could not be determined. Fixes: metal3-io#916 Signed-off-by: Henrik Holmboe <henrik@dynamist.se>
3606e97 to
5810188
Compare
|
https://opendev.org/openstack/ironic-inspector/commit/29dce28b13323970e1e0b0b56b29b6162b8dfbf2 is relevant to anyone reviewing this PR. |
|
The DHCP options does not carry the same option number in DHCP for IPv4 and DHCPv6.
bash-5.1$ dnsmasq --help dhcp6
Known DHCPv6 options:
21 sip-server-domain
22 sip-server
23 dns-server
24 domain-search
27 nis-server
28 nis+-server
29 nis-domain
30 nis+-domain
31 sntp-server
32 information-refresh-time
56 ntp-server
59 bootfile-url
60 bootfile-param
61 client-arch
62 client-interface-id
bash-5.1$ dnsmasq --help dhcp
Known DHCP options:
1 netmask
2 time-offset
3 router
6 dns-server
7 log-server
9 lpr-server
13 boot-file-size
15 domain-name
16 swap-server
17 root-path
18 extension-path
19 ip-forward-enable
20 non-local-source-routing
21 policy-filter
22 max-datagram-reassembly
23 default-ttl
26 mtu
27 all-subnets-local
31 router-discovery
32 router-solicitation
33 static-route
34 trailer-encapsulation
35 arp-timeout
36 ethernet-encap
37 tcp-ttl
38 tcp-keepalive
40 nis-domain
41 nis-server
42 ntp-server
44 netbios-ns
45 netbios-dd
46 netbios-nodetype
47 netbios-scope
48 x-windows-fs
49 x-windows-dm
58 T1
59 T2
60 vendor-class
64 nis+-domain
65 nis+-server
66 tftp-server
67 bootfile-name
68 mobile-ip-home
69 smtp-server
70 pop3-server
71 nntp-server
74 irc-server
77 user-class
80 rapid-commit
93 client-arch
94 client-interface-id
97 client-machine-id
119 domain-search
120 sip-server
121 classless-static-route
125 vendor-id-encap
150 tftp-server-address
255 server-ip-address |
Signed-off-by: Henrik Holmboe <henrik@dynamist.se>
diconico07
left a comment
There was a problem hiding this comment.
I don't think we have IPv6 e2e tests, but these changes are looking good to me
|
/test metal3-centos-e2e-integration-test-main |
|
Comming from #924, I can confirm that this works fine for amd64 IPv6, thank you |
tuminoid
left a comment
There was a problem hiding this comment.
LGTM too but I'm not dhcp guy.
/cc @Rozzii @elfosardo @dtantsur
There was a problem hiding this comment.
Pull request overview
Updates the dnsmasq Jinja2 template to correctly detect PXE client architecture during DHCPv6 so UEFI nodes can receive an appropriate bootfile URL and successfully PXE boot over IPv6.
Changes:
- Switch DHCPv6 architecture matching from
option:client-arch(DHCPv4-only) to DHCPv6 option 61 viaoption6:61. - Replace the IPv6 “BIOS fallback” (
undionly.kpxeover IPv6) with an x86_64 EFI fallback when arch detection fails. - Add template comments clarifying why numeric option 61 is used instead of the
client-archalias.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/hold |
|
/unhold I've tested it with ipv6 only and it looks good |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: diconico07, elfosardo, kema-dev The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
option:client-arch(DHCPv4-only alias for option 93) withoption6:client-arch(DHCPv6 option 61, RFC 5970)undionly.kpxeover IPv6) with x86_64 EFI fallback for PXE clients whose architecture could not be determinedRoot cause
The IPv6 section of
dnsmasq.conf.j2usedoption:client-archindhcp-matchdirectives. In dnsmasq,option:is a DHCPv4-only prefix — it resolvesclient-archto option 93 viaopttab[]and adds the match rule todaemon->dhcp_match. The DHCPv6 server code (rfc3315.c) only iteratesdaemon->dhcp_match6, so these rules were silently ignored. Theamd64/arm64tags were never set, the EFI bootfile was never served, and UEFI nodes could not PXE boot over IPv6.The correct syntax is
option6:client-arch, which resolves to DHCPv6 option 61 viaopttab6[]. Both EDK2/OVMF and iPXE send this option in DHCPv6 SOLICIT messages.Note:
option6:client-archrequires theclient-archentry in dnsmasq'sopttab6[]table. Upstream dnsmasq is missing this entry, but Red Hat has carried a downstream patch adding it since 2021, which is included in the CentOS Stream 9 base image used by this container.Test plan
make buildsucceeds (w/CONTAINER_ENGINE=docker make build)IPV=6and verify dnsmasq config renders correctlysnponly-x86_64.efisnponly-x86_64.efisnponly-arm64.efi-- will not be tested, no access to relevant hardwareboot.ipxe) still works whenIPXE_TLS_SETUP != "true"-- will not be tested, hoping for relevant e2e testsFixes: #916
UPDATE: Play it safe re. upstream dnsmasq vs Red Hat patches by using
option6:61in favor of aliasoption6:client-arch.