-
Notifications
You must be signed in to change notification settings - Fork 122
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
Getting "socket: permission denied" when running in UDP mode in linux #25
Comments
Most probably you are bit by a kernel change in recent Ubuntus (or maybe even upstream). More explanations you will get here: https://lwn.net/Articles/422330/ HTH |
Another problem with this code is at line: |
@karasz can we just modify the sudoers file to run the command inherently with sudo privileges? |
Fastping provides a more effective means to timeout requests (MaxRTT). Note this plugin will require that it be run as root (see tatsushid/go-fastping#25)
@seantcanavan You could, but then you're taking all the risks and issues associated with running your program as root. Unless there's something specific that's stopping you from using the workaround karasz mentioned, it would be much safer to not run with root. |
@bmon I was referring specifically to adding the ping command to the sudoers file and not the entire fastping process itself. this would technically constitute least-privilege permissions escalation. |
Just hit this. Seems like changing the "net.ipv4.ping_group_range" value as a workaround should be documented somewhere other than only in an old issue. |
I've changed the network to udp mode with
p.Network("udp")
to avoid the need for sudo privileges, but I getsocket: permission denied
as an error.When run with debug on, it prints:
2016/06/16 14:52:34 Run(): Start
2016/06/16 14:52:34 Run(): close(p.ctx.done)
Running without
p.Network("udp")
works fine (but requires sudo).The error is identical in 32 bit and 64 bit Ubuntu 14.04.
The same code works as intended on mac.
The text was updated successfully, but these errors were encountered: