diff options
author | Dave Barach <dave@barachs.net> | 2019-11-13 17:12:47 -0500 |
---|---|---|
committer | Dave Barach <dave@barachs.net> | 2019-11-13 17:13:26 -0500 |
commit | 211b9f6ad3e2c4d1b54e85cebf062571ced969b2 (patch) | |
tree | c1e33f513e7e494617af77e39a7b276ebdf3cac3 /src/plugins/dhcp/client.c | |
parent | d9ca7c9604aa67c6eb9ec3b25e3903918555b816 (diff) |
dhcp: option 61 add missing type field
Apparently some dhcp servers care about it. Also fixed the unit-test.
Type: fix
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: If0af70d624f4122b0339f20f84be047053776fe8
Diffstat (limited to 'src/plugins/dhcp/client.c')
-rw-r--r-- | src/plugins/dhcp/client.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/dhcp/client.c b/src/plugins/dhcp/client.c index f38e3fdfa8d..105c744a147 100644 --- a/src/plugins/dhcp/client.c +++ b/src/plugins/dhcp/client.c @@ -658,8 +658,10 @@ send_dhcp_pkt (dhcp_client_main_t * dcm, dhcp_client_t * c, if (vec_len (c->client_identifier)) { o->option = 61; - o->length = vec_len (c->client_identifier); - clib_memcpy (o->data, c->client_identifier, + o->length = vec_len (c->client_identifier) + 1; + /* Set type to zero, apparently some dhcp servers care */ + o->data[0] = 0; + clib_memcpy (o->data + 1, c->client_identifier, vec_len (c->client_identifier)); o = (dhcp_option_t *) (((uword) o) + (o->length + 2)); } @@ -1172,7 +1174,7 @@ dhcp_client_set_command_fn (vlib_main_t * vm, a->is_add = is_add; a->sw_if_index = sw_if_index; a->hostname = hostname; - a->client_identifier = format (0, "vpe 1.0%c", 0); + a->client_identifier = format (0, "vpp 1.1%c", 0); a->set_broadcast_flag = set_broadcast_flag; /* |