Skip to content

ff_hook_recvfrom sh_fromlen not init by *fromlen #872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

liujinhui-job
Copy link

@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
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.

None yet

2 participants