summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2020-10-08 17:44:36 +0200
committerDamjan Marion <dmarion@me.com>2020-10-17 08:28:59 +0000
commit03b76a20c569b8275beb8783691300a7d66b54a4 (patch)
tree08718cd1d9ca373dbc365880e6c297fbe03d5ce2 /src/vnet/devices
parent250bf9697f613ff5c2241742d898eda5f33da8d0 (diff)
tap: replaces strlen to vec_len
Type: fix Change-Id: I478b6fc54c47f0e77a1470ed29fdd56774671441 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/devices')
-rw-r--r--src/vnet/devices/tap/tap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vnet/devices/tap/tap.c b/src/vnet/devices/tap/tap.c
index 4a02c5a627f..6ad01770cf0 100644
--- a/src/vnet/devices/tap/tap.c
+++ b/src/vnet/devices/tap/tap.c
@@ -207,7 +207,7 @@ tap_create_if (vlib_main_t * vm, tap_create_if_args_t * args)
{
host_if_name = (char *) args->host_if_name;
clib_memcpy (ifr.ifr_name, host_if_name,
- clib_min (IFNAMSIZ, strlen (host_if_name)));
+ clib_min (IFNAMSIZ, vec_len (host_if_name)));
}
else
{
@@ -955,19 +955,19 @@ tap_dump_ifs (tap_interface_details_t ** out_tapids)
{
clib_memcpy(tapid->host_if_name, vif->host_if_name,
MIN (ARRAY_LEN (tapid->host_if_name) - 1,
- strlen ((const char *) vif->host_if_name)));
+ vec_len (vif->host_if_name)));
}
if (vif->net_ns)
{
clib_memcpy(tapid->host_namespace, vif->net_ns,
MIN (ARRAY_LEN (tapid->host_namespace) - 1,
- strlen ((const char *) vif->net_ns)));
+ vec_len (vif->net_ns)));
}
if (vif->host_bridge)
{
clib_memcpy(tapid->host_bridge, vif->host_bridge,
MIN (ARRAY_LEN (tapid->host_bridge) - 1,
- strlen ((const char *) vif->host_bridge)));
+ vec_len (vif->host_bridge)));
}
if (vif->host_ip4_prefix_len)
clib_memcpy(tapid->host_ip4_addr.as_u8, &vif->host_ip4_addr, 4);