[PATCH 3/3] udhcpc6: add support for BOOTFILE_URL

Josef Bacik jbacik at fb.com
Tue May 17 16:29:51 UTC 2016


We may want to request the bootfile url from the server.  If we do populate
$ipv6bootfileurl with the response from the server.

Signed-off-by: Josef Bacik <jbacik at fb.com>
---
 networking/udhcp/d6_dhcpc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c
index 902c663..e2e39c7 100644
--- a/networking/udhcp/d6_dhcpc.c
+++ b/networking/udhcp/d6_dhcpc.c
@@ -143,6 +143,7 @@ static void option_to_env(uint8_t *option, uint8_t *option_end)
 	int len_m4 = option_end - option - 4;
 	while (len_m4 >= 0) {
 		uint32_t v32;
+		char *url;
 		char ipv6str[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff")];
 
 		if (option[0] != 0 || option[2] != 0)
@@ -217,6 +218,13 @@ static void option_to_env(uint8_t *option, uint8_t *option_end)
 
 			sprint_nip6(ipv6str, option + 4 + 4 + 1);
 			*new_env() = xasprintf("ipv6prefix=%s/%u", ipv6str, (unsigned)(option[4 + 4]));
+			break;
+		case D6_OPT_BOOTFILE_URL:
+			url = xzalloc(option[3] + 1);
+			memcpy(url, option + 4, option[3]);
+			*new_env() = xasprintf("ipv6bootfileurl=%s", url);
+			free(url);
+			break;
 		}
 		option += 4 + option[3];
 		len_m4 -= 4 + option[3];
-- 
2.5.0



More information about the busybox mailing list