-
Notifications
You must be signed in to change notification settings - Fork 46
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
'Cannot open BPF device' error on c.open() #47
Comments
I have no idea, I don't use macos. However, the tests all run fine on macos via Travis. |
Most likely a lack of permissions as the error text suggests. On most platforms you have to have special privileges to be able to start capturing packets on most network interfaces. |
@mscdex I have a similar problem on LINUX. I have libpcap and libpcap-dev installed. But at
I got
Do i need root privilege to able to start capturing packets on linux? |
Yes, the best solution is to start as root, start listening for packets, and then drop the privileges of the process using This is also a better solution than what you may find elsewhere online which may suggest to use |
|
I'm working on an Electron App that broadcasts UDP to find specific devices connected to the network and it is throwing an error on this line:
var linkType = c.open(device, filter, bufSize, buffer);
This is the error on the console: Uncaught Error: (cannot open BPF device) /dev/bpf0: Permission denied
It works fine on my local environment, but when running the App on another Mac it's failing as described. Do I have to grant permissions to the App in order to be able to open the Cap object (c)? I've tried using the sudo-prompt module but it is not working.
The text was updated successfully, but these errors were encountered: