[PATCH 1/3] net: dhcp: use private extension 224 also in discover requests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Oleg Karfich <oleg.karfich@xxxxxxxx>
---
 include/dhcp.h | 1 +
 net/dhcp.c     | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/include/dhcp.h b/include/dhcp.h
index 0977ff4..ce5ed61 100644
--- a/include/dhcp.h
+++ b/include/dhcp.h
@@ -18,6 +18,7 @@ struct dhcp_req_param {
 	char *client_id;
 	char *user_class;
 	char *client_uuid;
+	char *option224;
 	int retries;
 };
 
diff --git a/net/dhcp.c b/net/dhcp.c
index d30551d..6394397 100644
--- a/net/dhcp.c
+++ b/net/dhcp.c
@@ -98,6 +98,7 @@ struct dhcp_receivce_opts {
 #define DHCP_CLIENT_ID		61
 #define DHCP_USER_CLASS		77
 #define DHCP_CLIENT_UUID	97
+#define DHCP_OPTION224		224
 
 static int dhcp_set_ip_options(int option, u8 *e, IPaddr_t ip)
 {
@@ -212,6 +213,7 @@ static int dhcp_extended(u8 *e, int message_type, IPaddr_t ServerID,
 	e += dhcp_set_string_options(DHCP_CLIENT_ID, dhcp_param.client_id, e);
 	e += dhcp_set_string_options(DHCP_USER_CLASS, dhcp_param.user_class, e);
 	e += dhcp_set_string_options(DHCP_CLIENT_UUID, dhcp_param.client_uuid, e);
+	e += dhcp_set_string_options(DHCP_OPTION224, dhcp_param.option224, e);
 
 	*e++ = 55;		/* Parameter Request List */
 	cnt = e++;		/* Pointer to count of requested items */
@@ -446,6 +448,7 @@ static char *global_dhcp_bootfile;
 static char *global_dhcp_oftree_file;
 static char *global_dhcp_rootpath;
 static char *global_dhcp_tftp_server_name;
+static char *global_dhcp_option224;
 
 static void set_res(char **var, const char *res)
 {
@@ -478,6 +481,8 @@ int dhcp_request(struct eth_device *edev, const struct dhcp_req_param *param,
 		dhcp_param.client_uuid = global_dhcp_client_uuid;
 	if (!dhcp_param.client_id)
 		dhcp_param.client_id = global_dhcp_client_id;
+	if (!dhcp_param.option224)
+		dhcp_param.option224 = global_dhcp_option224;
 	if (!dhcp_param.retries)
 		dhcp_param.retries = DHCP_DEFAULT_RETRY;
 
@@ -624,6 +629,7 @@ static int dhcp_global_init(void)
 	globalvar_add_simple_string("dhcp.user_class", &global_dhcp_user_class);
 	globalvar_add_simple_string("dhcp.oftree_file", &global_dhcp_oftree_file);
 	globalvar_add_simple_string("dhcp.tftp_server_name", &global_dhcp_tftp_server_name);
+	globalvar_add_simple_string("dhcp.option224", &global_dhcp_option224);
 
 	return 0;
 }
@@ -639,3 +645,4 @@ BAREBOX_MAGICVAR_NAMED(global_dhcp_user_class, global.dhcp.user_class, "user cla
 BAREBOX_MAGICVAR_NAMED(global_dhcp_tftp_server_name, global.dhcp.tftp_server_name, "TFTP server Name returned from DHCP request");
 BAREBOX_MAGICVAR_NAMED(global_dhcp_oftree_file, global.dhcp.oftree_file, "OF tree returned from DHCP request (option 224)");
 BAREBOX_MAGICVAR_NAMED(global_dhcp_retries, global.dhcp.retries, "retry limit");
+BAREBOX_MAGICVAR_NAMED(global_dhcp_option224, global.dhcp.option224, "private data to send to the DHCP server (option 224)");
-- 
2.7.4

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux