Skip to content

Commit

Permalink
Use IFLA_LINKINFO and IFLA_INFO_KIND from libc
Browse files Browse the repository at this point in the history
  • Loading branch information
gluxon committed Jan 1, 2020
1 parent fddfdb9 commit 571725f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ readme = "README.md"
[dependencies]
derive_builder = "0.7.1"
failure = "0.1.5"
libc = "0.2.51"
libc = "0.2.66"
neli = "0.4.3"

[dev-dependencies]
Expand Down
7 changes: 1 addition & 6 deletions src/socket/link_message.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::consts::WG_GENL_NAME;
use libc::{IFLA_INFO_KIND, IFLA_LINKINFO};
use neli::consts::{Arphrd, Ifla, NlmF, Rtm};
use neli::err::SerError;
use neli::nl::Nlmsghdr;
Expand All @@ -10,12 +11,6 @@ use neli::StreamWriteBuffer;

const RTATTR_HEADER_LEN: libc::c_ushort = 4;

// https://github.com/torvalds/linux/blob/54ecb8f7/include/uapi/linux/if_link.h#L133
const IFLA_LINKINFO: libc::c_ushort = 18;

// https://github.com/torvalds/linux/blob/54ecb8f7/include/uapi/linux/if_link.h#L356
const IFLA_INFO_KIND: libc::c_ushort = 1;

pub enum WireGuardDeviceLinkOperation {
Add,
Delete,
Expand Down

0 comments on commit 571725f

Please sign in to comment.