Coder Social home page Coder Social logo

Comments (6)

karasz avatar karasz commented on June 18, 2024 1

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.

karasz avatar karasz commented on June 18, 2024

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.

seantcanavan avatar seantcanavan commented on June 18, 2024

@karasz can we just modify the sudoers file to run the command inherently with sudo privileges?

from go-fastping.

bmon avatar bmon commented on June 18, 2024

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

seantcanavan avatar seantcanavan commented on June 18, 2024

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

eikenb avatar eikenb commented on June 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.