Skip to content

Commit 99065f0

Browse files
zhaozihanzzhzhaozihanzzh
authored andcommitted
Fix cplen calculation
1 parent 8b0b62d commit 99065f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adapter/syscall/ff_hook_syscall.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ ff_hook_getsockname(int fd, struct sockaddr *name,
419419
SYSCALL(FF_SO_GETSOCKNAME, args);
420420

421421
if (ret == 0) {
422-
socklen_t cplen = *namelen ? *sh_namelen > *namelen
422+
socklen_t cplen = *namelen < *sh_namelen ? *namelen
423423
: *sh_namelen;
424424
rte_memcpy(name, sh_name, cplen);
425425
*namelen = *sh_namelen;

0 commit comments

Comments
 (0)