Comments (3)
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.
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.
😱 👍 Thanks a lot!
from gen_icmp.
Related Issues (16)
- rebar compile won't work HOT 6
- Match error with [{:error, 'google.com', :nxdomain}] HOT 1
- Build on OS X HOT 3
- How to make use of Elapsed value in response HOT 1
- get timeout in tracert:host({8,8,8,8}). HOT 1
- Sending packets via specific network interfaces HOT 4
- :gen__icmp.ping crashes on CentOS 7 HOT 4
- Trouble running via elixir releases HOT 4
- Works on ubuntu v20 (x86_64); timeouts on custom ARM 32-bit Linux distro. HOT 2
- ipv6 works on linux, but not on mac HOT 2
- Compilation fails on macOS (arm64) HOT 4
- how to get the same display as a ping command ? HOT 2
- ipv6 support HOT 2
- Build fails with current pkt master HOT 1
- Deprecation of erlang:now() HOT 2
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 gen_icmp.