bootcode incompliant with DHCP RFC2131 - DISCOVER & OFFER but no REQUEST or ACK

Open
#1,699 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale

Research direction

Start with bootcode.bin, the attached packet capture, and RFC 2131 sections 3.1.3 and 3.1.4; compare the observed DHCPDISCOVER/DHCPOFFER exchange with the required sequence. Done means the netboot flow sends DHCPREQUEST, waits for DHCPACK or DHCPNAK, and only then contacts the TFTP server.

Written by the indexing model from the issue text.

Description

Describe the bug
Netbootcode in bootcode.bin is not behaving in an RFC 2131-compliant manner when booting BOOTP/PXE.

  1. A DHCPDISCOVER is sent by RPi.
  2. A DHCPOFFERs are collected. Once the one carrying SIADDR and/or(?) Option 66 containing TFTP reference has been observed RPi netbootcode stops following any semblance of prescribed procedure, configures the offered IP address and goes for the TFTP server.

To reproduce

  1. Place latest bootcode.bin on the SD card.
  2. Configure DHCP with TFTP options.
  3. Launch tcpdump/wireshark on DHCP server or anywhere on the network (DISCOVER, OFFER and REQUEST are all broadcasts) and observe captured traffic.
  4. Run the RPi on.

Expected behaviour
RFC2131 Section 3.1.3 and 3.1.4 clearly mandate what should happen next:

  1. RPI netbootcode should consume a DHCPOFFER and send a DHCPREQUEST to the server that produced it to actually request that IP from the server.
  2. The server in turn will reply with DHCPACK confirming IP selection or DHCPNAK if the previously offered IP has been allocated.
  3. Then and only then, should netbootcode actually go for TFTP server having received confirmation it can use the offered IP.

Actual behaviour
Without confirming with the DHCP that offered it the requested configuration, RPi netbootcode uses the IP offered. Problem is, in a busy environment this may result in conflicts, offer thrashing and mess on the network where offered IPs are reused and doubly allocated.

System

Logs
Attached.

Additional context
None.

Dominant language
No language data
Stars
5.6k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/firmware

All issues in raspberrypi/firmware

Similar issues

More Embedded & IoT issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.