diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-11-15 19:44:03 +0100 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-11-15 19:44:03 +0100 |
commit | 697e7f4de49aa92d14b5070f82dffc1471b5b197 (patch) | |
tree | d42414fd574f7a910991877d26ea78c7115f0bb6 | |
parent | e2587976f5a686e53472ce12b92b1ed348c1831a (diff) |
make interface a constant0.3.3
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/main.rs | 5 |
3 files changed, 5 insertions, 4 deletions
@@ -384,7 +384,7 @@ dependencies = [ [[package]] name = "rsdsl_dhcp6" -version = "0.3.2" +version = "0.3.3" dependencies = [ "dhcproto", "rand", @@ -1,6 +1,6 @@ [package] name = "rsdsl_dhcp6" -version = "0.3.2" +version = "0.3.3" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/main.rs b/src/main.rs index 1498dc5..4aa0b9a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,6 +18,7 @@ use socket2::{Domain, Socket, Type}; use trust_dns_proto::serialize::binary::BinDecodable; const DUID_LOCATION: &str = "/data/dhcp6.duid"; +const INTERFACE: &str = "ppp0"; const ALL_DHCPV6_SERVERS: SocketAddrV6 = SocketAddrV6::new(Ipv6Addr::new(0xff02, 0, 0, 0, 0, 0, 1, 2), 547, 0, 0); @@ -130,7 +131,7 @@ async fn main() -> Result<()> { println!("[info] wait for pppoe"); let mut already_up = true; - while let Err(e) = sock.bind_device(Some("ppp0".as_bytes())) { + while let Err(e) = sock.bind_device(Some(INTERFACE.as_bytes())) { if e.raw_os_error() == Some(19) { // "No such device" doesn't have an ErrorKind. already_up = false; @@ -155,7 +156,7 @@ async fn main() -> Result<()> { Some(ds_config) if ds_config.v6.is_some() => { println!("[info] <> ipv6 link up"); - sock.bind_device(Some("ppp0".as_bytes()))?; + sock.bind_device(Some(INTERFACE.as_bytes()))?; dhcp6c.up(); } _ => { |