diff options
author | Damjan Marion <damarion@cisco.com> | 2020-12-12 23:32:12 +0100 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-12-14 12:14:21 +0000 |
commit | 62c25abaa3e93be5815172d391295a6ab0390122 (patch) | |
tree | 3d252a33a032c8c3320f6b007b61b6ee29b161b8 /src/vnet/devices/virtio/vhost_user.c | |
parent | dc01471be72b272922bf6c9ef9e6221162ab906a (diff) |
vppinfra: simpler and faster pool_foreach
- reduces number of instructions generated 4 times compared to old code
- adds pool_foreach2 which is more friendly to clang-format
Type: improvement
Change-Id: I51e9c7fb09655c60d883987dadf5b2666c12b3f7
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/vhost_user.c')
-rw-r--r-- | src/vnet/devices/virtio/vhost_user.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/vnet/devices/virtio/vhost_user.c b/src/vnet/devices/virtio/vhost_user.c index d8c79ea17aa..f7cecef4d19 100644 --- a/src/vnet/devices/virtio/vhost_user.c +++ b/src/vnet/devices/virtio/vhost_user.c @@ -1230,6 +1230,7 @@ vhost_user_process (vlib_main_t * vm, /* try to connect */ strncpy (sun.sun_path, (char *) vui->sock_filename, sizeof (sun.sun_path) - 1); + sun.sun_path[sizeof (sun.sun_path) - 1] = 0; /* Avoid hanging VPP if the other end does not accept */ if (fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0) |