← index #10172PR #12499
Related · high · value 0.644
QUERY · ISSUE

Fix DHCP server for certain clients (dhcpcd)

openby peterharperukopened 2022-12-05updated 2022-12-17
bugport-rp2

We use the Micropython dhcp server in our examples. An issue has been identified. You should consider taking the fix? See https://github.com/raspberrypi/pico-examples/pull/288

See https://github.com/hathach/tinyusb/pull/1712 and the initial trigger https://github.com/OpenLightingProject/rp2040-dmxsun/issues/53:
The included DHCP server fails to process DHCP DISCOVER or REQUEST packages that don't contain the "DHCP MESSAGE TYPE" option as the first option in the package.
The initial report that triggered me was in https://github.com/OpenLightingProject/rp2040-dmxsun/issues/53 and after some investigation, I found that the "dhcpcd" client (maybe others, too) don't send the MESSAGE TYPE as the first option (see Wireshark dump attached in the linked issue). This seems to be valid since the order of the options contained in the package shouldn't matter. However, > tinyUSB's DHCP server expects the MESSAGE TYPE to be the first option.
This change uses the already existing function to extract the MESSAGE TYPE option from the options properly. It will also fail now, if the MESSAGE TYPE option doesn't exist at all, making the code safer than the current approach.

CANDIDATE · PULL REQUEST

shared/netutils/dhcpserver: Reply on correct netif

mergedby samveenopened 2023-09-22updated 2023-09-29

The DHCP server broadcasts messages. This are being sent via the default netif which might be completely the wrong network. We want to send messages to the netif we got the original message from.

Original author: Peter Harper
Source: https://github.com/raspberrypi/pico-examples/pull/392

Motivation: https://forums.raspberrypi.com/viewtopic.php?t=347699

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied