Skip to content
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

Support EtherAddr and impl Debug for InterfaceAddress/SockAddr #813

Merged
merged 2 commits into from
Jan 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
([#814](https://github.com/nix-rust/nix/pull/814))
- Added `sigprocmask` to the signal module.
([#826](https://github.com/nix-rust/nix/pull/826))
- Added `nix::sys::socket::LinkAddr` on Linux and all bsdlike system.
([#813](https://github.com/nix-rust/nix/pull/813))

### Changed
- Use native `pipe2` on all BSD targets. Users should notice no difference.
Expand Down
9 changes: 1 addition & 8 deletions src/ifaddrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//! of interfaces and their associated addresses.

use std::ffi;
use std::fmt;
use std::iter::Iterator;
use std::mem;
use std::option::Option;
Expand All @@ -16,7 +15,7 @@ use sys::socket::SockAddr;
use net::if_::*;

/// Describes a single address for an interface as returned by `getifaddrs`.
#[derive(Clone, Eq, Hash, PartialEq)]
#[derive(Clone, Eq, Hash, PartialEq, Debug)]
pub struct InterfaceAddress {
/// Name of the network interface
pub interface_name: String,
Expand All @@ -32,12 +31,6 @@ pub struct InterfaceAddress {
pub destination: Option<SockAddr>,
}

impl fmt::Debug for InterfaceAddress {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "InterfaceAddress ({:?})", self.interface_name)
}
}

cfg_if! {
if #[cfg(any(target_os = "emscripten", target_os = "fuchsia", target_os = "linux"))] {
fn get_ifu_from_sockaddr(info: &libc::ifaddrs) -> *const libc::sockaddr {
Expand Down
Loading