Soft'N'Design Software
/
projects
/
benchmarks.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6c70a3d
)
change recv to recvfrom
author
Laurent MAZET
<laurent.mazet@thalesgroup.com>
Wed, 15 Oct 2025 16:33:06 +0000
(18:33 +0200)
committer
Laurent MAZET
<laurent.mazet@thalesgroup.com>
Wed, 15 Oct 2025 16:33:06 +0000
(18:33 +0200)
udp_lat.c
patch
|
blob
|
blame
|
history
diff --git
a/udp_lat.c
b/udp_lat.c
index 3b47f8d0a0c3197d55b2503055b8f952b6ec479c..8b7e5619fc4552a15f70ab5d82209a21e4040a78 100644
(file)
--- a/
udp_lat.c
+++ b/
udp_lat.c
@@
-138,7
+138,9
@@
void *pong (__attribute__((unused)) void *arg)
pthread_mutex_unlock (mutex);
char buffer[MAXBUF] = { 0 };
- if (recv (sock, buffer, MAXBUF, 0) == -1) {
+ struct sockaddr_in src = { 0 };
+ socklen_t alen = sizeof (src);
+ if (recvfrom (sock, buffer, MAXBUF, 0, (struct sockaddr *)&src, &alen) == -1) {
fprintf (stderr, "pong error: recv_from (%d)\n", i);
rc = 1;
pthread_exit (NULL);