diff options
-rw-r--r-- | src/plugins/dpdk/device/init.c | 5 | ||||
-rw-r--r-- | src/vppinfra/format.h | 4 | ||||
-rw-r--r-- | src/vppinfra/unformat.c | 3 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c index b64f76bf185..f9927dbeebc 100644 --- a/src/plugins/dpdk/device/init.c +++ b/src/plugins/dpdk/device/init.c @@ -287,14 +287,15 @@ dpdk_lib_init (dpdk_main_t * dm) if (vmbus_dev) { unformat_input_t input_vmbus; - - unformat_init_vector (&input_vmbus, (u8 *) dev_info.device->name); + unformat_init_string (&input_vmbus, dev_info.device->name, + strlen (dev_info.device->name)); if (unformat (&input_vmbus, "%U", unformat_vlib_vmbus_addr, &vmbus_addr)) { p = mhash_get (&dm->conf->device_config_index_by_vmbus_addr, &vmbus_addr); } + unformat_free (&input_vmbus); } if (p) diff --git a/src/vppinfra/format.h b/src/vppinfra/format.h index 70882adac99..cad9b0e0ef2 100644 --- a/src/vppinfra/format.h +++ b/src/vppinfra/format.h @@ -242,8 +242,8 @@ uword va_unformat (unformat_input_t * i, const char *fmt, va_list * args); void unformat_init_command_line (unformat_input_t * input, char *argv[]); /* Setup for unformat of given string. */ -void unformat_init_string (unformat_input_t * input, - char *string, int string_len); +void unformat_init_string (unformat_input_t *input, const char *string, + int string_len); always_inline void unformat_init_cstring (unformat_input_t * input, char *string) diff --git a/src/vppinfra/unformat.c b/src/vppinfra/unformat.c index 172182f8a34..0f6da4fd3b9 100644 --- a/src/vppinfra/unformat.c +++ b/src/vppinfra/unformat.c @@ -1026,7 +1026,8 @@ unformat_init_command_line (unformat_input_t * input, char *argv[]) } __clib_export void -unformat_init_string (unformat_input_t * input, char *string, int string_len) +unformat_init_string (unformat_input_t *input, const char *string, + int string_len) { unformat_init (input, 0, 0); if (string_len > 0) |