Skip to content
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

[defect]: radclient return value incorrect when network unreachable #5338

Closed
WhiteCat0214 opened this issue Jun 12, 2024 · 2 comments
Closed
Labels
defect category: a defect or misbehaviour

Comments

@WhiteCat0214
Copy link

WhiteCat0214 commented Jun 12, 2024

What type of defect/bug is this?

Unexpected behaviour (obvious or verified by project member)

How can the issue be reproduced?

Execute radclient at device which network unreachable. (Failed to send packet)
packet is not send but return value is 0 (success).

At end of radclient.c, it only verify stats.lost and stats.failed values.
if ((stats.lost > 0) || (stats.failed > 0)) { exit(1); }
I think it's better to add a judgment when all values ​​​​are 0.
if ((stats.lost > 0) || (stats.failed > 0) || (stats.accepted == 0 && stats.rejected == 0 && stats.lost == 0 && stats.passed == 0 && stats.failed == 0)) { exit(1); }

Log output from the FreeRADIUS daemon

no matter

Relevant log output from client utilities

root@Router:~# /usr/bin/radclient -sxF -n 1 -f /tmp/test -t 1 192.168.214.55:1812 auth testing123 && echo 1 || echo 0
(0) Failed to send packet for ID 85: sendto failed: Network unreachable
Packet summary:
Accepted : 0
Rejected : 0
Lost : 0
Passed filter : 0
Failed filter : 0
1

I except it will echo 0

Backtrace from LLDB or GDB

no matter
@WhiteCat0214 WhiteCat0214 added the defect category: a defect or misbehaviour label Jun 12, 2024
@alandekok
Copy link
Member

I've pushed a different fix. Please verify.

@WhiteCat0214
Copy link
Author

WhiteCat0214 commented Jun 25, 2024

I've pushed a different fix. Please verify.

root@Router:~# /usr/bin/radclient -sxF -n 1 -f /tmp/test -t 1 192.168.214.55:1812 auth testing123 && echo 1 || echo 0
(0) Failed to send packet for ID 177: sendto failed: Network unreachable
Packet summary:
Accepted : 0
Rejected : 0
Lost : 1
Passed filter : 0
Failed filter : 0
0

It works, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect category: a defect or misbehaviour
Projects
None yet
Development

No branches or pull requests

2 participants