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
if (vec_len (c->client_identifier))
{
o->option = 61;
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));
}
vec_len (c->client_identifier));
o = (dhcp_option_t *) (((uword) o) + (o->length + 2));
}
a->is_add = is_add;
a->sw_if_index = sw_if_index;
a->hostname = hostname;
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;
/*
a->set_broadcast_flag = set_broadcast_flag;
/*
self.verify_dhcp_has_option(pkt, "hostname",
hostname.encode('ascii'))
if client_id:
self.verify_dhcp_has_option(pkt, "hostname",
hostname.encode('ascii'))
if client_id:
+ client_id = '\x00' + client_id
self.verify_dhcp_has_option(pkt, "client_id",
client_id.encode('ascii'))
bootp = pkt[BOOTP]
self.verify_dhcp_has_option(pkt, "client_id",
client_id.encode('ascii'))
bootp = pkt[BOOTP]