fdc011f21a
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
116 lines
3.6 KiB
Diff
116 lines
3.6 KiB
Diff
From 96d1972ca872559fc70ad847a53bf9e20417e505 Mon Sep 17 00:00:00 2001
|
|
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|
Date: Sun, 28 Apr 2019 10:43:24 +0200
|
|
Subject: [PATCH] Use pnet_* subcrates
|
|
|
|
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
|
---
|
|
src/main.rs | 1 -
|
|
src/network.rs | 2 +-
|
|
src/providers/digitalocean/mod.rs | 2 +-
|
|
src/providers/packet/mod.rs | 2 +-
|
|
src/providers/vagrant_virtualbox/mod.rs | 6 +++---
|
|
src/util/mod.rs | 4 ++--
|
|
6 files changed, 8 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/src/main.rs b/src/main.rs
|
|
index 337f3da..9743425 100644
|
|
--- a/src/main.rs
|
|
+++ b/src/main.rs
|
|
@@ -22,7 +22,6 @@ extern crate ipnetwork;
|
|
extern crate nix;
|
|
extern crate openssh_keys;
|
|
extern crate openssl;
|
|
-extern crate pnet;
|
|
extern crate reqwest;
|
|
#[macro_use]
|
|
extern crate serde_derive;
|
|
diff --git a/src/network.rs b/src/network.rs
|
|
index f084a75..d12037d 100644
|
|
--- a/src/network.rs
|
|
+++ b/src/network.rs
|
|
@@ -16,7 +16,7 @@
|
|
//! interface unit files. All that is left is to write the resulting string to
|
|
//! the necessary unit.
|
|
|
|
-use pnet::util::MacAddr;
|
|
+use pnet_base::MacAddr;
|
|
use std::net::IpAddr;
|
|
use std::string::String;
|
|
use std::string::ToString;
|
|
diff --git a/src/providers/digitalocean/mod.rs b/src/providers/digitalocean/mod.rs
|
|
index eeaa7c2..e6ad868 100644
|
|
--- a/src/providers/digitalocean/mod.rs
|
|
+++ b/src/providers/digitalocean/mod.rs
|
|
@@ -21,7 +21,7 @@ use std::str::FromStr;
|
|
use ipnetwork;
|
|
use ipnetwork::{IpNetwork, Ipv4Network, Ipv6Network};
|
|
use openssh_keys::PublicKey;
|
|
-use pnet::util::MacAddr;
|
|
+use pnet_base::MacAddr;
|
|
|
|
use crate::errors::*;
|
|
use crate::network;
|
|
diff --git a/src/providers/packet/mod.rs b/src/providers/packet/mod.rs
|
|
index f471baf..3a42520 100644
|
|
--- a/src/providers/packet/mod.rs
|
|
+++ b/src/providers/packet/mod.rs
|
|
@@ -23,7 +23,7 @@ use std::net::{IpAddr, Ipv4Addr, Ipv6Addr};
|
|
use std::str::FromStr;
|
|
|
|
use openssh_keys::PublicKey;
|
|
-use pnet::util::MacAddr;
|
|
+use pnet_base::MacAddr;
|
|
|
|
use crate::errors::*;
|
|
use crate::network::{self, Device, Interface, NetworkRoute, Section};
|
|
diff --git a/src/providers/vagrant_virtualbox/mod.rs b/src/providers/vagrant_virtualbox/mod.rs
|
|
index e4d4109..5d5ee40 100644
|
|
--- a/src/providers/vagrant_virtualbox/mod.rs
|
|
+++ b/src/providers/vagrant_virtualbox/mod.rs
|
|
@@ -21,7 +21,7 @@ use std::time::Duration;
|
|
|
|
use hostname;
|
|
use openssh_keys::PublicKey;
|
|
-use pnet;
|
|
+use pnet_datalink;
|
|
|
|
use crate::errors::*;
|
|
use crate::network;
|
|
@@ -52,8 +52,8 @@ impl VagrantVirtualboxProvider {
|
|
Err("eth1 was not found!".into())
|
|
}
|
|
|
|
- fn find_eth1() -> Option<pnet::datalink::NetworkInterface> {
|
|
- let mut ifaces = pnet::datalink::interfaces();
|
|
+ fn find_eth1() -> Option<pnet_datalink::NetworkInterface> {
|
|
+ let mut ifaces = pnet_datalink::interfaces();
|
|
ifaces.retain(|i| i.name == "eth1");
|
|
if !ifaces.is_empty() {
|
|
Some(ifaces[0].clone())
|
|
diff --git a/src/util/mod.rs b/src/util/mod.rs
|
|
index 80ab3c7..daa49b1 100644
|
|
--- a/src/util/mod.rs
|
|
+++ b/src/util/mod.rs
|
|
@@ -16,7 +16,7 @@
|
|
|
|
use crate::errors::*;
|
|
use crate::retry;
|
|
-use pnet;
|
|
+use pnet_datalink;
|
|
use std::fs::File;
|
|
use std::io::{BufRead, BufReader, Read};
|
|
use std::path::Path;
|
|
@@ -52,7 +52,7 @@ pub fn key_lookup<R: Read>(delim: char, key: &str, reader: R) -> Result<Option<S
|
|
}
|
|
|
|
pub fn dns_lease_key_lookup(key: &str) -> Result<String> {
|
|
- let interfaces = pnet::datalink::interfaces();
|
|
+ let interfaces = pnet_datalink::interfaces();
|
|
trace!("interfaces - {:?}", interfaces);
|
|
|
|
retry::Retry::new()
|
|
--
|
|
2.21.0
|
|
|