Skip to content

Conversation

@liujinhui-job
Copy link
Contributor

@liujinhui-job liujinhui-job commented Mar 24, 2025

In ff_hook_recvfrom function, sh_fromlen is not init by fromlen, default value is 0.
Standard udp server is:
recvfrom(sockfd, buffer, BUFFER_SIZE, 0, (struct sockaddr*)&cli_addr, &addr_len);
then
sendto(sockfd, buffer, recv_len, 0, (const struct sockaddr*)&cli_addr, addr_len);

because ff_hook_recvfrom output addr_len is 0,so ff_hook_sendto return -1

@liujinhui-job liujinhui-job changed the title ff_hook_recvfrom sh_fromlen not init, ff_sys_recvfrom will return -1 ff_hook_recvfrom sh_fromlen not init by *fromlen Mar 24, 2025
@jfb8856606
Copy link
Contributor

This function has not been actually tested before, thanks for the cr.

@jfb8856606 jfb8856606 merged commit 63196ac into F-Stack:dev Mar 27, 2025
1 check passed
@liujinhui-job liujinhui-job deleted the fix-ff_hook_recvfrom-sh_fromlen-not-init-error branch June 8, 2025 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants