Hi,
I included a patch for the udhcpc applet. RFC 2131 section 3.1.6 clearly
states: "If the client used a 'client identifier' when it obtained the
lease, it MUST use the same 'client identifier' in the DHCPRELEASE
message." Currently the udhcpc applet does not do that for client
identifiers provided using option -x 61:<hex string>. This patch fixes
that.
Met vriendelijke groet / Kind regards,
Richard van Paasen
From fa6def4efe2d442d1f85a336d852c507d8723e0d Mon Sep 17 00:00:00 2001
From: Richard van Paasen <[email protected]>
Date: Thu, 20 May 2021 14:42:56 +0200
Subject: [PATCH] Include option 61 (Client Identifier) in the DHCPRELEASE
message according RFC2131
---
networking/udhcp/dhcpc.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 6666cbce6..2db88252d 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -876,6 +876,20 @@ int send_release(uint32_t server, uint32_t ciaddr)
udhcp_add_simple_option(&packet, DHCP_SERVER_ID, server);
+ { // RFC 2131 section 3.1.6 states:
+ // If the client used a 'client identifier' when it obtained the lease,
+ // it MUST use the same 'client identifier' in the DHCPRELEASE message.
+ struct option_set *curr = client_data.options;
+ while (curr) {
+ uint8_t code = curr->data[OPT_CODE];
+ if (code == 0x3d) {
+ udhcp_add_binary_option(&packet, curr->data);
+ break;
+ }
+ curr = curr->next;
+ }
+ }
+
bb_info_msg("sending %s", "release");
/* Note: normally we unicast here since "server" is not zero.
* However, there _are_ people who run "address-less" DHCP servers,
--
2.14.1
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox