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
Errors on android #664
Comments
On further debugging, the error originates here: let (typ, proto) = match config.channel_type {
super::ChannelType::Layer2 => (libc::SOCK_RAW, eth_p_all),
super::ChannelType::Layer3(proto) => (libc::SOCK_DGRAM, proto),
};
let socket = unsafe { libc::socket(libc::AF_PACKET, typ, proto.to_be() as i32) };
if socket == -1 {
return Err(io::Error::last_os_error()); // here
} |
Afaik, you can't create a socket with |
@Martichou Is there an alternative this library can use to it works on all android? |
The goal of this (I suppose you use datalink), is to get all packets. And afaik there's not other way (at least, not without root permission). Raw sockets provide unrestricted access to the underlying protocols, which can be a security risks if misused. So the vast majority of OSes restrict it to superuser. |
Hi there,
I'm trying out this crate on an android device but I'm facing this error
This is the code surrounding line 78
The code is from the examples folder (arp_packet.rs)
The text was updated successfully, but these errors were encountered: