diff options
author | Marc Brinkmann <git@marcbrinkmann.de> | 2016-01-27 16:58:52 +0100 |
---|---|---|
committer | Kamal Marhubi <kamal@marhubi.com> | 2016-01-27 15:10:42 -0500 |
commit | 939e4aa77a1403be0c51f12cd2921fc9c52918ce (patch) | |
tree | 4b38c0a8a8d073872f941ebbcb3a4078e54e3fd5 /src | |
parent | 4a2de56c6af5f30b97cd83295dcedd1f14012676 (diff) | |
download | nix-939e4aa77a1403be0c51f12cd2921fc9c52918ce.zip |
Do not use extern, but if_nametoindex from libc instead.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/if_.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/net/if_.rs b/src/net/if_.rs index 26028f93..19f4e6fc 100644 --- a/src/net/if_.rs +++ b/src/net/if_.rs @@ -3,7 +3,7 @@ //! Uses Linux and/or POSIX functions to resolve interface names like "eth0" //! or "socan1" into device numbers. -use libc::{c_char, c_uint}; +use libc::{c_uint, if_nametoindex}; use std::ffi::{CString, NulError}; use std::io; @@ -27,10 +27,6 @@ impl From<io::Error> for NameToIndexError { } } -extern { - fn if_nametoindex(ifname: *const c_char) -> c_uint; -} - /// Resolve an interface into a interface number. pub fn name_to_index(name: &str) -> Result<c_uint, NameToIndexError> { let name = try!(CString::new(name)); |