Giter Club home page Giter Club logo

Comments (3)

ferd avatar ferd commented on July 30, 2024

https://github.com/msantos/procket#setuid-vs-sudo-vs-capabilities contains the details about permissions iirc -- it's the underlying library under gen_icmp.

from gen_icmp.

msantos avatar msantos commented on July 30, 2024

The {:error, :eperm} means the user running beam doesn't have permission to open an ICMP socket. The link @ferd provided has more info on how to set up the helper binary.

The second error you are seeing happens because gen_icmp expects an Erlang string not a binary. Using a string works:

iex(2)> :gen_icmp.ping("ya.ru")
** (FunctionClauseError) no function clause matching in :gen_icmp.ping/3
    src/gen_icmp.erl:147: :gen_icmp.ping(#PID<0.63.0>, "ya.ru", [])
    src/gen_icmp.erl:143: :gen_icmp.ping/2

iex(2)> :gen_icmp.ping('ya.ru')
[{:ok, 'ya.ru', {93, 158, 134, 3}, {93, 158, 134, 3}, {49359, 0, 52, 277},
  " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK"}]

Let me know if any of this is not clear or if you run into any other problems!

from gen_icmp.

foi avatar foi commented on July 30, 2024

😱 👍 Thanks a lot!

from gen_icmp.

Related Issues (16)

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.