diff options
author | Aleksander Djuric <aleksander.djuric@gmail.com> | 2019-10-30 12:26:46 +0300 |
---|---|---|
committer | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2019-10-30 14:46:03 +0000 |
commit | 00217cb192be43e2bc3fcacb5440fb0a4a733c0b (patch) | |
tree | e6e7f84a05a17767225e613f473f8dc84b74700c | |
parent | 97c998c2813d7cea4a067a0b8ff246cad4924bf3 (diff) |
dhcp: allocate memory for dns
Type: fix
Signed-off-by: Aleksander Djuric <aleksander.djuric@gmail.com>
Change-Id: I56375d5d53eb07d80c1b12513798317f60c81a6d
Signed-off-by: Aleksander Djuric <aleksander.djuric@gmail.com>
-rw-r--r-- | src/plugins/dhcp/dhcp_api.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/dhcp/dhcp_api.c b/src/plugins/dhcp/dhcp_api.c index 744d8386d44..a5163ca2e95 100644 --- a/src/plugins/dhcp/dhcp_api.c +++ b/src/plugins/dhcp/dhcp_api.c @@ -372,11 +372,17 @@ send_dhcp_client_entry (const dhcp_client_t * client, void *arg) { dhcp_client_send_walk_ctx_t *ctx; vl_api_dhcp_client_details_t *mp; + u32 count; + size_t n; ctx = arg; - mp = vl_msg_api_alloc (sizeof (*mp)); - clib_memset (mp, 0, sizeof (*mp)); + count = vec_len (client->domain_server_address); + n = sizeof (*mp) + (count * sizeof (vl_api_domain_server_t)); + mp = vl_msg_api_alloc (n); + if (!mp) + return 0; + clib_memset (mp, 0, n); mp->_vl_msg_id = ntohs (VL_API_DHCP_CLIENT_DETAILS + REPLY_MSG_ID_BASE); mp->context = ctx->context; |