Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
vppinfra: added lock performance test for clib_spinlock_t (test_spinlock.c)
[vpp.git]
/
src
/
vppinfra
/
socket.c
diff --git
a/src/vppinfra/socket.c
b/src/vppinfra/socket.c
index
29b2a94
..
bcee3de
100644
(file)
--- a/
src/vppinfra/socket.c
+++ b/
src/vppinfra/socket.c
@@
-73,7
+73,7
@@
find_free_port (word sock)
{
struct sockaddr_in a;
{
struct sockaddr_in a;
-
memset (&a, 0, sizeof (a));
/* Warnings be gone */
+
clib_memset (&a, 0, sizeof (a));
/* Warnings be gone */
a.sin_family = PF_INET;
a.sin_addr.s_addr = INADDR_ANY;
a.sin_family = PF_INET;
a.sin_addr.s_addr = INADDR_ANY;
@@
-278,7
+278,7
@@
default_socket_sendmsg (clib_socket_t * s, void *msg, int msglen,
{
struct msghdr mh = { 0 };
struct iovec iov[1];
{
struct msghdr mh = { 0 };
struct iovec iov[1];
- char ctl[CMSG_SPACE (sizeof (int)
) * num_fds
];
+ char ctl[CMSG_SPACE (sizeof (int)
* num_fds)
];
int rv;
iov[0].iov_base = msg;
int rv;
iov[0].iov_base = msg;
@@
-289,7
+289,7
@@
default_socket_sendmsg (clib_socket_t * s, void *msg, int msglen,
if (num_fds > 0)
{
struct cmsghdr *cmsg;
if (num_fds > 0)
{
struct cmsghdr *cmsg;
- memset (&ctl, 0, sizeof (ctl));
+
clib_
memset (&ctl, 0, sizeof (ctl));
mh.msg_control = ctl;
mh.msg_controllen = sizeof (ctl);
cmsg = CMSG_FIRSTHDR (&mh);
mh.msg_control = ctl;
mh.msg_controllen = sizeof (ctl);
cmsg = CMSG_FIRSTHDR (&mh);
@@
-328,7
+328,7
@@
default_socket_recvmsg (clib_socket_t * s, void *msg, int msglen,
mh.msg_control = ctl;
mh.msg_controllen = sizeof (ctl);
mh.msg_control = ctl;
mh.msg_controllen = sizeof (ctl);
- memset (ctl, 0, sizeof (ctl));
+
clib_
memset (ctl, 0, sizeof (ctl));
/* receive the incoming message */
size = recvmsg (s->fd, &mh, 0);
/* receive the incoming message */
size = recvmsg (s->fd, &mh, 0);
@@
-356,7
+356,8
@@
default_socket_recvmsg (clib_socket_t * s, void *msg, int msglen,
#endif
if (cmsg->cmsg_type == SCM_RIGHTS)
{
#endif
if (cmsg->cmsg_type == SCM_RIGHTS)
{
- clib_memcpy (fds, CMSG_DATA (cmsg), num_fds * sizeof (int));
+ clib_memcpy_fast (fds, CMSG_DATA (cmsg),
+ num_fds * sizeof (int));
}
}
cmsg = CMSG_NXTHDR (&mh, cmsg);
}
}
cmsg = CMSG_NXTHDR (&mh, cmsg);
@@
-525,7
+526,7
@@
clib_socket_accept (clib_socket_t * server, clib_socket_t * client)
clib_error_t *err = 0;
socklen_t len = 0;
clib_error_t *err = 0;
socklen_t len = 0;
- memset (client, 0, sizeof (client[0]));
+
clib_
memset (client, 0, sizeof (client[0]));
/* Accept the new socket connection. */
client->fd = accept (server->fd, 0, 0);
/* Accept the new socket connection. */
client->fd = accept (server->fd, 0, 0);