aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2023-08-13 19:10:54 +0200
committerHimbeerserverDE <himbeerserverde@gmail.com>2023-08-13 19:10:54 +0200
commite030b03ea543061db0a6ae712c3f6ec372373fc2 (patch)
treead842ce8ad51b64b9b540f79bb0a255f73f55cc7
parent6f9b97eb8d9db25b1d249262ff42beb47e9f3a31 (diff)
exit if native ipv6 is available
-rw-r--r--Cargo.lock20
-rw-r--r--Cargo.toml4
-rw-r--r--src/main.rs11
3 files changed, 28 insertions, 7 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 3cac022..1ee9fb8 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -882,21 +882,23 @@ dependencies = [
[[package]]
name = "rsdsl_ip_config"
-version = "0.2.1"
-source = "git+https://github.com/rsdsl/ip_config.git#26c15096a1f4b69c6c06b5373b507c9dbbfc54c5"
+version = "0.2.2"
+source = "git+https://github.com/rsdsl/ip_config.git#3239a5eeef22de4c50d4d00a9f51bebb5207633c"
dependencies = [
"serde",
]
[[package]]
name = "rsdsl_netlinkd"
-version = "0.5.0"
-source = "git+https://github.com/rsdsl/netlinkd.git#644023c680db2346c3144e7218d9ece7402e65b5"
+version = "0.6.0"
+source = "git+https://github.com/rsdsl/netlinkd.git#72f04e3494b4f3ba810274447235e9051f5e1749"
dependencies = [
"futures-util",
+ "ipnet",
"netlink-packet-route",
"notify",
"rsdsl_ip_config",
+ "rsdsl_pd_config",
"rtnetlink",
"serde_json",
"thiserror",
@@ -906,7 +908,7 @@ dependencies = [
[[package]]
name = "rsdsl_netlinkd_sys"
version = "0.4.0"
-source = "git+https://github.com/rsdsl/netlinkd.git#644023c680db2346c3144e7218d9ece7402e65b5"
+source = "git+https://github.com/rsdsl/netlinkd.git#72f04e3494b4f3ba810274447235e9051f5e1749"
dependencies = [
"bindgen",
"cc",
@@ -914,6 +916,14 @@ dependencies = [
]
[[package]]
+name = "rsdsl_pd_config"
+version = "0.1.0"
+source = "git+https://github.com/rsdsl/pd_config.git#98ee1876a08a1c3844d0b439a8ba52e5b3423810"
+dependencies = [
+ "serde",
+]
+
+[[package]]
name = "rtnetlink"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index 4e2955a..83a2efa 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,8 +11,8 @@ libc = "0.2.143"
notify = "5.1.0"
reqwest = { version = "0.11.17", default-features = false, features = ["blocking", "rustls-tls"] }
rsdsl_he_config = { git = "https://github.com/rsdsl/he_config.git", version = "0.1.0" }
-rsdsl_ip_config = { git = "https://github.com/rsdsl/ip_config.git", version = "0.2.1" }
-rsdsl_netlinkd = { git = "https://github.com/rsdsl/netlinkd.git", version = "0.5.0" }
+rsdsl_ip_config = { git = "https://github.com/rsdsl/ip_config.git", version = "0.2.2" }
+rsdsl_netlinkd = { git = "https://github.com/rsdsl/netlinkd.git", version = "0.6.0" }
rsdsl_netlinkd_sys = { git = "https://github.com/rsdsl/netlinkd.git", version = "0.4.0" }
serde_json = "1.0"
thiserror = "1.0"
diff --git a/src/main.rs b/src/main.rs
index ef3311b..9afafc5 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -55,6 +55,17 @@ fn main() -> Result<()> {
thread::sleep(Duration::from_secs(8));
}
+ // Check for native connectivity to avoid breaking netlinkd.
+ {
+ let mut file = File::open(rsdsl_ip_config::LOCATION)?;
+ let dsconfig: DsConfig = serde_json::from_reader(&mut file)?;
+
+ if dsconfig.v6.is_some() {
+ println!("use native ipv6");
+ return Ok(());
+ }
+ }
+
let local = local_address()?;
let _tnl = Sit::new("he6in4", "ppp0", local, config.serv)?;