summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorOleg.Karfich@wago.com <Oleg.Karfich@wago.com>2018-08-31 09:01:32 +0000
committerSascha Hauer <s.hauer@pengutronix.de>2018-09-04 10:07:52 +0200
commite9321ffd79bbf58549e2ed56d91728204b5f3b83 (patch)
treeabcc4ed2ca523e23f14e437dbe991ab10fec4de1 /net
parente3e55fa3aa698bb92fa4362a36e102749c13c124 (diff)
downloadbarebox-e9321ffd79bbf58549e2ed56d91728204b5f3b83.tar.gz
barebox-e9321ffd79bbf58549e2ed56d91728204b5f3b83.tar.xz
net: dhcp: use private extension 224 also in discover requests
Signed-off-by: Oleg Karfich <oleg.karfich@wago.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net')
-rw-r--r--net/dhcp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/dhcp.c b/net/dhcp.c
index d30551d8f3..639439787d 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)");