🛂 Check for required permissions

On Linux, checks for the `CAP_NET_ADMIN` capability.
On macOS, checks for root.
This commit is contained in:
Malted 2023-06-10 17:25:08 +01:00 committed by Ben
parent 6bd8051c78
commit 40cc0ba049
7 changed files with 60 additions and 5 deletions

View file

@ -6,7 +6,7 @@ use std::io::{IoSlice, Write};
use std::net::{Ipv4Addr, SocketAddrV4};
use std::os::fd::{AsRawFd, RawFd};
use std::{
io::{Error, Read},
io::{Error},
mem,
};

View file

@ -71,7 +71,7 @@ mod test {
use super::*;
use std::io::Write;
use std::io::{self, BufRead};
use std::net::Ipv4Addr;
#[throws]