[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH 3/3] udhcpc6: add support for BOOTFILE_URL
From:       Josef Bacik <jbacik () fb ! com>
Date:       2016-05-17 16:29:51
Message-ID: 1463502591-9286-4-git-send-email-jbacik () fb ! com
[Download RAW message or body]

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@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

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic