aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/dhcp/client.c
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-07-18 09:26:53 -0700
committerNeale Ranns <nranns@cisco.com>2017-07-18 19:05:03 +0000
commit51822bf07a3f0fe72834ea94659faf6e262475ba (patch)
tree55acdc249df261a92d0ec09bb7c05a2d4fa7ca44 /src/vnet/dhcp/client.c
parenta2fbf6ba0e2553687f56d9a9fb63e2972bdb26c6 (diff)
DHCP client option 61 "client_id"
the existing seeting of client_id to a VPP version number was unused and so overridden Change-Id: If9ebea936336f1fcca8d07e67186c95f8f8f0ccd Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/dhcp/client.c')
-rw-r--r--src/vnet/dhcp/client.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/vnet/dhcp/client.c b/src/vnet/dhcp/client.c
index 8f033d25198..25ab3176ae5 100644
--- a/src/vnet/dhcp/client.c
+++ b/src/vnet/dhcp/client.c
@@ -414,6 +414,16 @@ send_dhcp_pkt (dhcp_client_main_t * dcm, dhcp_client_t * c,
o = (dhcp_option_t *) (((uword) o) + (o->length + 2));
}
+ /* send option 61, client_id */
+ if (vec_len (c->client_identifier))
+ {
+ o->option = 61;
+ o->length = vec_len (c->client_identifier);
+ clib_memcpy (o->data, c->client_identifier,
+ vec_len (c->client_identifier));
+ o = (dhcp_option_t *) (((uword) o) + (o->length + 2));
+ }
+
/* $$ maybe send the client s/w version if anyone cares */
/*
@@ -838,6 +848,7 @@ int
dhcp_client_config (vlib_main_t * vm,
u32 sw_if_index,
u8 * hostname,
+ u8 * client_id,
u32 is_add,
u32 client_index,
void * event_callback,
@@ -854,7 +865,9 @@ dhcp_client_config (vlib_main_t * vm,
a->event_callback = event_callback;
vec_validate(a->hostname, strlen((char *)hostname) - 1);
strncpy((char *)a->hostname, (char *)hostname, vec_len(a->hostname));
- a->client_identifier = format (0, "vpe 1.0%c", 0);
+ vec_validate(a->client_identifier, strlen((char *)client_id) - 1);
+ strncpy((char *)a->client_identifier, (char *)client_id, vec_len(a->client_identifier));
+
/*
* Option 55 request list. These data precisely match
* the Ubuntu dhcp client. YMMV.