diff options
author | Sascha Grunert <mail@saschagrunert.de> | 2017-02-23 15:34:37 +0100 |
---|---|---|
committer | Sascha Grunert <mail@saschagrunert.de> | 2017-02-23 15:34:37 +0100 |
commit | 72c79fbfb119b5f1c16fededb422f585683ddcbc (patch) | |
tree | 3bcef19565236ac269f662bcb2422c65c4e68b06 | |
parent | Exclude mmsghdr (diff) | |
download | wireguard-rs-72c79fbfb119b5f1c16fededb422f585683ddcbc.tar.xz wireguard-rs-72c79fbfb119b5f1c16fededb422f585683ddcbc.zip |
Using the libc ioctl
-rw-r--r-- | build.rs | 3 | ||||
-rw-r--r-- | src/device.rs | 3 |
2 files changed, 3 insertions, 3 deletions
@@ -8,7 +8,7 @@ use std::io::Write; use std::error::Error; use std::path::PathBuf; -static HEADERS: &'static [&'static str] = &["net/if.h", "linux/if_tun.h", "sys/ioctl.h", "uapi.h"]; +static HEADERS: &'static [&'static str] = &["linux/if_tun.h", "uapi.h"]; fn main() { run().expect("Could not execute build script."); @@ -29,7 +29,6 @@ fn run() -> Result<(), Box<Error>> { .no_unstable_rust() .generate_comments(true) .hide_type("pthread_mutex_t") - .hide_type("mmsghdr") .header(wrapper_path_str) .clang_arg("-I./src/wireguard/src") .generate() diff --git a/src/device.rs b/src/device.rs index 6df9483..7d5ddad 100644 --- a/src/device.rs +++ b/src/device.rs @@ -6,6 +6,7 @@ use std::os::unix::io::AsRawFd; use std::path::{Path, PathBuf}; use bindgen; +use libc::ioctl; use error::WgResult; #[derive(Debug)] @@ -53,7 +54,7 @@ impl Device { } // Create the tunnel device - if unsafe { bindgen::ioctl(fd.as_raw_fd(), bindgen::TUNSETIFF, &ifr) < 0 } { + if unsafe { ioctl(fd.as_raw_fd(), bindgen::TUNSETIFF, &ifr) < 0 } { bail!("Device creation failed."); } |