[PATCH v5 0/3] dhcp: Add support for Rapid Commit, broadcast replies
These are all changes coming from pending muvm experiments where I'm trying to speed up and simplify the networking setup in the guest. v5: In 2/3, keep the condition: (opts[53].clen <= 0 || opts[53].c[0] == DHCPREQUEST) as it was, instead of replacing || with && v4: In 1/3, don't swap the "BOOTP" and "DHCP" labels: we want to print "BOOTP" if option 53 isn't there or has zero length, not the other way around. Further, check that clen for option 53 is > 0 before checking if it's a DHCPDISCOVER. Given that DHCPDISCOVER is 1 (not 0), this happened to already work for BOOTP, but it worked by mistake v3: In 1/3, set 'slen' for options we won't send to -1 in dhcp_init(), and reset it for option 80 every time we handle a DHCP request. Add a comment about DHCP needing a valid message type (option 53) v2: In 3/3, add in4addr_broadcast to ip.h, instead of open-coding it in dhcp() Stefano Brivio (3): dhcp: Use -1 as "missing option" length instead of 0 dhcp: Introduce support for Rapid Commit (option 80, RFC 4039) dhcp: Honour broadcast flag (RFC 2131, 4.1) dhcp.c | 53 +++++++++++++++++++++++++++++++++++++++++------------ ip.h | 3 +++ 2 files changed, 44 insertions(+), 12 deletions(-) -- 2.43.0
We want to add support for option 80 (Rapid Commit, RFC 4039), whose
length is 0.
Signed-off-by: Stefano Brivio
I'm trying to speed up and simplify IP address acquisition in muvm.
Signed-off-by: Stefano Brivio
It's widely considered a legacy option nowadays, and I've haven't seen
clients setting it since Windows 95, but it's convenient for a minimal
DHCP client not using raw IP sockets such as what I'm playing with for
muvm.
Signed-off-by: Stefano Brivio
participants (1)
-
Stefano Brivio