Comments (6)
Most probably you are bit by a kernel change in recent Ubuntus (or maybe even upstream).
You can do a sysctl net.ipv4.ping_group_range
if the response is 1 0
then the UDP variant will not work. To enable all users to use that facility you need
sudo sysctl -w net.ipv4.ping_group_range="0 65535"
.
More explanations you will get here: https://lwn.net/Articles/422330/
HTH
from go-fastping.
Another problem with this code is at line:
https://github.com/tatsushid/go-fastping/blob/master/fastping.go#L652
when UDP is enabled pkt.ID == p.id
is not true due to the way the kernel handles ID of those packets.
when using UDP one should only rely on the sequences, ,or properly handle the packet IDs.
from go-fastping.
@karasz can we just modify the sudoers file to run the command inherently with sudo privileges?
from go-fastping.
@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.
from go-fastping.
@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.
from go-fastping.
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.
from go-fastping.
Related Issues (20)
- Pinger.run() should return immediately when packet recieved HOT 4
- lost return ip
- Is it possible to stop the pinger after OnRecv?
- Is there a plan to add jitter and packet loss calculation?
- tips
- RunLoop issue, after Stop() is issued HOT 7
- Is there a plan to add MTU discovery?
- AddIP/RemoveIP() AddIPAddr/RemoveIPAddr() could make a panic in concurrent environment
- What is the meaning of UDP ping? HOT 1
- Anyone using this library use this command HOT 6
- dep ensure Solve(): No versions of github.com/tatsushid/go-fastping met constraints
- I can't ping same ip at once time HOT 2
- go-fastping randomly crash with panic: close of closed channel
- icmp AddIPAddr ping lots of ip , return unstable HOT 1
- Ping failed when size is more then 512 on Windows
- there's not output when ip unreachable
- runtime error: invalid memory address or nil pointer dereference
- Support for error callback function
- How to get network interface from the ping result?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-fastping.