From cabfade4824817b60fe3bf9a9b152a96193a23f7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 28 Apr 2026 20:38:51 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Sync=202026-04-28=2020:38:51?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gowebdav/Makefile | 4 +- hickory-dns/Makefile | 2 +- .../files/etc/hickory-dns/forwarder.toml | 10 + hickory-dns/files/etc/hickory-dns/lan.zone | 11 + ipv6-neigh/Cargo.lock | 1493 +++++++++++++++++ ipv6-neigh/Cargo.toml | 24 + ipv6-neigh/Makefile | 51 + ipv6-neigh/files/etc/init.d/ipv6-neigh | 20 + ipv6-neigh/src/db.rs | 107 ++ ipv6-neigh/src/main.rs | 298 ++++ ipv6-neigh/src/op.rs | 39 + luci-app-amlogic/Makefile | 4 +- luci-app-amlogic/root/usr/sbin/openwrt-kernel | 8 +- luci-app-passwall/Makefile | 2 +- .../model/cbi/passwall/client/type/ray.lua | 7 - .../luasrc/passwall/util_xray.lua | 3 +- luci-app-passwall/po/zh-cn/passwall.po | 6 - .../root/usr/share/passwall/iptables.sh | 17 +- .../root/usr/share/passwall/nftables.sh | 11 +- .../root/usr/share/passwall/utils.sh | 30 + .../resources/view/network/wireless.js | 33 +- 21 files changed, 2134 insertions(+), 46 deletions(-) create mode 100644 hickory-dns/files/etc/hickory-dns/lan.zone create mode 100644 ipv6-neigh/Cargo.lock create mode 100644 ipv6-neigh/Cargo.toml create mode 100644 ipv6-neigh/Makefile create mode 100644 ipv6-neigh/files/etc/init.d/ipv6-neigh create mode 100644 ipv6-neigh/src/db.rs create mode 100644 ipv6-neigh/src/main.rs create mode 100644 ipv6-neigh/src/op.rs diff --git a/gowebdav/Makefile b/gowebdav/Makefile index fd00bb7f..ac07b102 100644 --- a/gowebdav/Makefile +++ b/gowebdav/Makefile @@ -6,8 +6,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gowebdav -PKG_VERSION:=5.11.6 -PKG_RELEASE:=6 +PKG_VERSION:=5.11.7 +PKG_RELEASE:=7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/hacdias/webdav/tar.gz/v$(PKG_VERSION)? diff --git a/hickory-dns/Makefile b/hickory-dns/Makefile index 6a5a0fa5..4116a794 100644 --- a/hickory-dns/Makefile +++ b/hickory-dns/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hickory-dns PKG_VERSION:=0.26.0-beta.2 -PKG_RELEASE:=15 +PKG_RELEASE:=16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/hickory-dns/hickory-dns/tar.gz/v$(PKG_VERSION)? diff --git a/hickory-dns/files/etc/hickory-dns/forwarder.toml b/hickory-dns/files/etc/hickory-dns/forwarder.toml index a84ac8d2..c1db3372 100644 --- a/hickory-dns/files/etc/hickory-dns/forwarder.toml +++ b/hickory-dns/files/etc/hickory-dns/forwarder.toml @@ -2,6 +2,16 @@ listen_addrs_ipv6 = ["::1"] listen_port = 5335 prometheus_listen_addr = "[::]:9000" +[[zones]] +zone = "lan" +zone_type = "Primary" + +[zones.stores] +type = "sqlite" +zone_path = "/etc/hickory-dns/lan.zone" +journal_path = "/var/lib/hickory-dns/lan.jrnl" +allow_update = true + [[zones]] zone = "." zone_type = "External" diff --git a/hickory-dns/files/etc/hickory-dns/lan.zone b/hickory-dns/files/etc/hickory-dns/lan.zone new file mode 100644 index 00000000..bd1e3828 --- /dev/null +++ b/hickory-dns/files/etc/hickory-dns/lan.zone @@ -0,0 +1,11 @@ +$TTL 60 +@ IN SOA ns.lan. admin.lan. ( + 1 ; Serial + 3600 ; Refresh + 600 ; Retry + 86400 ; Expire + 60 ) ; Negative caching TTL + + IN NS ns.lan. + +ns IN AAAA ::1 diff --git a/ipv6-neigh/Cargo.lock b/ipv6-neigh/Cargo.lock new file mode 100644 index 00000000..5cccbb09 --- /dev/null +++ b/ipv6-neigh/Cargo.lock @@ -0,0 +1,1493 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "bitflags" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "cc" +version = "1.2.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16d90359e986641506914ba71350897565610e87ce0ad9e6f28569db3dd5c6d" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chacha20" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" +dependencies = [ + "cfg-if", + "cpufeatures", + "rand_core", +] + +[[package]] +name = "clap" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +dependencies = [ + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "data-encoding" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4ae5f15dda3c708c0ade84bfee31ccab44a3da4f88015ed22f63732abe300c8" + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "getrandom" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "rand_core", + "wasip2", + "wasip3", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hickory-proto" +version = "0.26.0-beta.3" +source = "git+https://github.com/hickory-dns/hickory-dns.git?rev=34a4cca1a707b642052b427938b7d1e8aaa71e3a#34a4cca1a707b642052b427938b7d1e8aaa71e3a" +dependencies = [ + "data-encoding", + "idna", + "ipnet", + "jni", + "once_cell", + "rand", + "ring", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "url", +] + +[[package]] +name = "icu_collections" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.0", + "serde", + "serde_core", +] + +[[package]] +name = "ip-neigh" +version = "0.1.0" +dependencies = [ + "clap", + "futures", + "hickory-proto", + "netlink-packet-core", + "netlink-packet-route", + "netlink-sys", + "rtnetlink", + "serde_json", + "tokio", + "ubus", +] + +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "jni" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498" +dependencies = [ + "cfg-if", + "combine", + "jni-macros", + "jni-sys", + "log", + "simd_cesu8", + "thiserror 2.0.18", + "walkdir", + "windows-link", +] + +[[package]] +name = "jni-macros" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "simd_cesu8", + "syn", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "mio" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "netlink-packet-core" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72724faf704479d67b388da142b186f916188505e7e0b26719019c525882eda4" +dependencies = [ + "anyhow", + "byteorder", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-route" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "483325d4bfef65699214858f097d504eb812c38ce7077d165f301ec406c3066e" +dependencies = [ + "anyhow", + "bitflags", + "byteorder", + "libc", + "log", + "netlink-packet-core", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-utils" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34" +dependencies = [ + "anyhow", + "byteorder", + "paste", + "thiserror 1.0.69", +] + +[[package]] +name = "netlink-proto" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72452e012c2f8d612410d89eea01e2d9b56205274abb35d53f60200b2ec41d60" +dependencies = [ + "bytes", + "futures", + "log", + "netlink-packet-core", + "netlink-sys", + "thiserror 2.0.18", +] + +[[package]] +name = "netlink-sys" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd6c30ed10fa69cc491d491b85cc971f6bdeb8e7367b7cde2ee6cc878d583fae" +dependencies = [ + "bytes", + "futures-util", + "libc", + "log", + "tokio", +] + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" +dependencies = [ + "critical-section", + "portable-atomic", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "portable-atomic" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" + +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "zerovec", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207" +dependencies = [ + "chacha20", + "getrandom 0.4.2", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rtnetlink" +version = "0.14.1" +source = "git+https://github.com/rust-netlink/rtnetlink.git?rev=515471f#515471fa0d759316ab249b7c265f3073b3dc1ffb" +dependencies = [ + "futures", + "log", + "netlink-packet-core", + "netlink-packet-route", + "netlink-packet-utils", + "netlink-proto", + "netlink-sys", + "nix", + "thiserror 1.0.69", + "tokio", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "simd_cesu8" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94f90157bb87cddf702797c5dadfa0be7d266cdf49e22da2fcaa32eff75b2c33" +dependencies = [ + "rustc_version", + "simdutf8", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "storage_endian" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "450890d265e3f042570935184b2e429a50b51f487b7d0a443eb6489dd1e0c4d6" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.52.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67dee974fe86fd92cc45b7a95fdd2f99a36a6d7b0d431a231178d3d670bbcc6" +dependencies = [ + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "ubus" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d5669562d66269640d72933c3cc524aaf9a231a3ac50569b9924725ed21a8ed" +dependencies = [ + "serde", + "serde_json", + "storage_endian", + "thiserror 1.0.69", +] + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.3+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6" +dependencies = [ + "wit-bindgen 0.57.1", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen 0.51.0", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap", + "semver", +] + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "writeable" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" + +[[package]] +name = "yoke" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/ipv6-neigh/Cargo.toml b/ipv6-neigh/Cargo.toml new file mode 100644 index 00000000..3c3dcb5f --- /dev/null +++ b/ipv6-neigh/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "ip-neigh" +version = "0.1.0" +edition = "2024" + +[workspace] + +[dependencies] +rtnetlink = { git = "https://github.com/rust-netlink/rtnetlink.git", rev = "515471f" } +netlink-sys = { version = "0.8" } +tokio = { version = "1.0.1", features = ["full"]} +futures = "0.3.11" +netlink-packet-route = {version = "0.21" } +netlink-packet-core= {version ="0.7"} +clap = { version = "4.0", default-features = false, features = ["cargo", "derive", "help", "std", "suggestions"] } +hickory-proto = { git = "https://github.com/hickory-dns/hickory-dns.git", rev = "34a4cca1a707b642052b427938b7d1e8aaa71e3a" } +ubus = "0.1.6" +serde_json = "1.0.108" + +[profile.release] +opt-level = 3 +lto = true +codegen-units = 1 +strip = true diff --git a/ipv6-neigh/Makefile b/ipv6-neigh/Makefile new file mode 100644 index 00000000..44c75ea7 --- /dev/null +++ b/ipv6-neigh/Makefile @@ -0,0 +1,51 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=ipv6-neigh +PKG_VERSION:=0.1.0 +PKG_RELEASE:=1 + +PKG_BUILD_DEPENDS:=rust/host +PKG_BUILD_PARALLEL:=1 + +RUST_PKG_LOCKED:=0 + +include $(INCLUDE_DIR)/package.mk +include $(TOPDIR)/feeds/packages/lang/rust/rust-package.mk + +define Package/ipv6-neigh + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE:=LAN neighbor DNS updater for hickory-dns + URL:=https://github.com/nicebonn/hickory-dns-openwrt + DEPENDS:=$(RUST_ARCH_DEPENDS) +hickory-dns +endef + +define Package/ipv6-neigh/description + Monitors Linux neighbor table (ARP/NDP) via netlink and dynamically + updates DNS records in a local hickory-dns server using RFC 2136 + DNS UPDATE over TCP. Maps MAC addresses to hostnames via OpenWrt + DHCP leases (ubus). +endef + +define Build/Compile + +$(CARGO_PKG_VARS) \ + cargo build -v --profile $(CARGO_PKG_PROFILE) \ + --manifest-path "$(PKG_BUILD_DIR)/Cargo.toml" \ + --target $(RUSTC_TARGET_ARCH) \ + --no-default-features \ + $(if $(filter --jobserver%,$(PKG_JOBS)),,-j1) \ + $(CARGO_PKG_ARGS) + +$(INSTALL_DIR) $(PKG_INSTALL_DIR)/bin/ + +$(INSTALL_BIN) $(PKG_BUILD_DIR)/target/$(RUSTC_TARGET_ARCH)/$(CARGO_PKG_PROFILE)/ip-neigh $(PKG_INSTALL_DIR)/bin/ +endef + +define Package/ipv6-neigh/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/ip-neigh $(1)/usr/bin/ipv6-neigh + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) ./files/etc/init.d/ipv6-neigh $(1)/etc/init.d/ipv6-neigh +endef + +$(eval $(call RustBinPackage,ipv6-neigh)) +$(eval $(call BuildPackage,ipv6-neigh)) diff --git a/ipv6-neigh/files/etc/init.d/ipv6-neigh b/ipv6-neigh/files/etc/init.d/ipv6-neigh new file mode 100644 index 00000000..988a281b --- /dev/null +++ b/ipv6-neigh/files/etc/init.d/ipv6-neigh @@ -0,0 +1,20 @@ +#!/bin/sh /etc/rc.common + +USE_PROCD=1 +START=19 +STOP=50 + +PROG=/usr/bin/ipv6-neigh + +start_service() { + procd_open_instance ipv6-neigh + procd_set_param command $PROG -p -d "[::1]:5335" -z lan + procd_set_param stdout 1 + procd_set_param stderr 1 + procd_set_param respawn "${respawn_threshold:-3600}" "${respawn_timeout:-5}" "${respawn_retry:-5}" + procd_close_instance ipv6-neigh +} + +service_triggers() { + procd_add_reload_trigger "dhcp" "network" +} diff --git a/ipv6-neigh/src/db.rs b/ipv6-neigh/src/db.rs new file mode 100644 index 00000000..a93b17fa --- /dev/null +++ b/ipv6-neigh/src/db.rs @@ -0,0 +1,107 @@ +use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr}; + +use hickory_proto::op::{Message, ResponseCode, update_message}; +use hickory_proto::rr::{Name, RData, RecordSet, RecordType}; +use tokio::io::{AsyncReadExt, AsyncWriteExt}; +use tokio::net::TcpStream; + +/// DNS dynamic update client that sends RFC 2136 updates over TCP to the hickory-dns server. +pub(crate) struct DnsUpdater { + server_addr: SocketAddr, + zone: Name, +} + +impl DnsUpdater { + pub fn new(server_addr: SocketAddr, zone: Name) -> Self { + Self { server_addr, zone } + } + + /// Create or append a AAAA record. + pub async fn upsert_aaaa( + &self, + hostname: &str, + addr: Ipv6Addr, + ttl: u32, + ) -> Result<(), Box> { + let name = Name::from_ascii(hostname)?.append_domain(&self.zone)?; + let mut rrset = RecordSet::with_ttl(name.clone(), RecordType::AAAA, ttl); + rrset.add_rdata(RData::AAAA(addr.into())); + + let msg = update_message::create(rrset, self.zone.clone(), false); + let response = self.send_tcp(msg).await?; + if response.metadata.response_code == ResponseCode::YXRRSet { + let mut rrset = RecordSet::with_ttl(name, RecordType::AAAA, ttl); + rrset.add_rdata(RData::AAAA(addr.into())); + let msg = update_message::append(rrset, self.zone.clone(), false, false); + self.send_tcp(msg).await?; + } + Ok(()) + } + + /// Create or append an A record. + pub async fn upsert_a( + &self, + hostname: &str, + addr: Ipv4Addr, + ttl: u32, + ) -> Result<(), Box> { + let name = Name::from_ascii(hostname)?.append_domain(&self.zone)?; + let mut rrset = RecordSet::with_ttl(name.clone(), RecordType::A, ttl); + rrset.add_rdata(RData::A(addr.into())); + + let msg = update_message::create(rrset, self.zone.clone(), false); + let response = self.send_tcp(msg).await?; + if response.metadata.response_code == ResponseCode::YXRRSet { + let mut rrset = RecordSet::with_ttl(name, RecordType::A, ttl); + rrset.add_rdata(RData::A(addr.into())); + let msg = update_message::append(rrset, self.zone.clone(), false, false); + self.send_tcp(msg).await?; + } + Ok(()) + } + + /// Delete a specific AAAA record. + pub async fn delete_aaaa( + &self, + hostname: &str, + addr: Ipv6Addr, + ) -> Result<(), Box> { + let name = Name::from_ascii(hostname)?.append_domain(&self.zone)?; + let mut rrset = RecordSet::new(name, RecordType::AAAA, 0); + rrset.add_rdata(RData::AAAA(addr.into())); + let msg = update_message::delete_by_rdata(rrset, self.zone.clone(), false); + self.send_tcp(msg).await?; + Ok(()) + } + + /// Delete a specific A record. + pub async fn delete_a( + &self, + hostname: &str, + addr: Ipv4Addr, + ) -> Result<(), Box> { + let name = Name::from_ascii(hostname)?.append_domain(&self.zone)?; + let mut rrset = RecordSet::new(name, RecordType::A, 0); + rrset.add_rdata(RData::A(addr.into())); + let msg = update_message::delete_by_rdata(rrset, self.zone.clone(), false); + self.send_tcp(msg).await?; + Ok(()) + } + + /// Send a DNS message over TCP (2-byte length prefix + message bytes) and read the response. + async fn send_tcp(&self, msg: Message) -> Result> { + let bytes = msg.to_vec()?; + let len = u16::try_from(bytes.len())?; + + let mut stream = TcpStream::connect(self.server_addr).await?; + stream.write_all(&len.to_be_bytes()).await?; + stream.write_all(&bytes).await?; + stream.flush().await?; + + let resp_len = stream.read_u16().await? as usize; + let mut resp_buf = vec![0u8; resp_len]; + stream.read_exact(&mut resp_buf).await?; + + Ok(Message::from_vec(&resp_buf)?) + } +} diff --git a/ipv6-neigh/src/main.rs b/ipv6-neigh/src/main.rs new file mode 100644 index 00000000..df1444c7 --- /dev/null +++ b/ipv6-neigh/src/main.rs @@ -0,0 +1,298 @@ +use std::collections::HashMap; +use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr as StdSocketAddr}; + +use futures::stream::StreamExt; +use futures::stream::TryStreamExt; +use netlink_packet_core::NetlinkPayload; +use netlink_packet_route::RouteNetlinkMessage; +use netlink_packet_route::neighbour::NeighbourMessage; +use netlink_packet_route::neighbour::{NeighbourAddress, NeighbourAttribute, NeighbourState}; +use netlink_packet_route::route::RouteType; +use rtnetlink::{Error, Handle, new_connection}; + +use clap::Parser; +use hickory_proto::rr::Name; +use netlink_sys::{AsyncSocket, SocketAddr}; +mod db; +mod op; +const RTNLGRP_NEIGH: u32 = 3; + +const DEFAULT_TTL: u32 = 60; + +const fn nl_mgrp(group: u32) -> u32 { + if group > 31 { + panic!("use netlink_sys::Socket::add_membership() for this group"); + } + if group == 0 { 0 } else { 1 << (group - 1) } +} + +#[derive(Debug, Parser)] +#[clap()] +struct Cli { + #[clap(short, long)] + iface: Option, + #[clap(short, long)] + private_subnet: bool, + /// hickory-dns server address for DNS updates (e.g. "[::1]:5335") + #[clap(short, long, default_value = "[::1]:5335")] + dns_server: StdSocketAddr, + /// DNS zone to update (e.g. "lan") + #[clap(short, long, default_value = "lan")] + zone: String, +} + +#[derive(Debug)] +struct Neigh { + ifindex: u32, + state: NeighbourState, + kind: RouteType, + inet: NeighbourAddress, + mac: String, +} + +fn if_ipv6_in_private_subnet(ip: &Ipv6Addr) -> bool { + // Check if address is ULA (fc00::/7) + let is_ula = (ip.segments()[0] & 0xfe00) == 0xfc00; + + // Check if address is link-local (fe80::/10) + let is_link_local = (ip.segments()[0] & 0xffc0) == 0xfe80; + + is_ula || is_link_local +} + +fn if_ipv4_in_private_subnet(ip: &Ipv4Addr) -> bool { + // Check for private network ranges + let octets = ip.octets(); + + // 10.0.0.0/8 + if octets[0] == 10 { + return true; + } + + // 172.16.0.0/12 + if octets[0] == 172 && (octets[1] >= 16 && octets[1] <= 31) { + return true; + } + + // 192.168.0.0/16 + if octets[0] == 192 && octets[1] == 168 { + return true; + } + + // 127.0.0.0/8 (loopback) + if octets[0] == 127 { + return true; + } + + false +} + +async fn process_new_neigh(neigh: &Neigh, updater: &db::DnsUpdater, leases: &HashMap) { + let Some(hostname) = leases.get(&neigh.mac) else { + eprintln!("no lease for mac {}, skipping DNS update", neigh.mac); + return; + }; + let result = match &neigh.inet { + NeighbourAddress::Inet6(addr) => updater.upsert_aaaa(hostname, *addr, DEFAULT_TTL).await, + NeighbourAddress::Inet(addr) => updater.upsert_a(hostname, *addr, DEFAULT_TTL).await, + _ => return, + }; + match result { + Ok(()) => println!("DNS update: added {} -> {:?}", hostname, neigh.inet), + Err(e) => eprintln!("DNS update failed for {}: {}", hostname, e), + } +} + +async fn process_del_neigh(neigh: &Neigh, updater: &db::DnsUpdater, leases: &HashMap) { + let Some(hostname) = leases.get(&neigh.mac) else { + return; + }; + let result = match &neigh.inet { + NeighbourAddress::Inet6(addr) => updater.delete_aaaa(hostname, *addr).await, + NeighbourAddress::Inet(addr) => updater.delete_a(hostname, *addr).await, + _ => return, + }; + match result { + Ok(()) => println!("DNS update: removed {} -> {:?}", hostname, neigh.inet), + Err(e) => eprintln!("DNS delete failed for {}: {}", hostname, e), + } +} + +fn is_multicast_or_broadcast_route_type(route_type: RouteType) -> bool { + match route_type { + RouteType::Multicast => true, + RouteType::Broadcast => true, + _ => false, + } +} + +fn is_multicast_or_broadcast(neigh: &Neigh) -> bool { + return is_multicast_or_broadcast_route_type(neigh.kind); +} + +#[tokio::main] +async fn main() -> Result<(), ()> { + let args = Cli::parse(); + let private_subnet = args.private_subnet; + let zone = Name::from_ascii(&args.zone).expect("invalid zone name"); + let updater = db::DnsUpdater::new(args.dns_server, zone); + + let (connection, handle, _) = new_connection().unwrap(); + tokio::spawn(connection); + dump_addresses(handle.clone(), args.iface).await.unwrap(); + + // Load DHCP leases (mac -> hostname) from ubus + let mut leases = op::get_lease().unwrap_or_default(); + println!("loaded {} DHCP leases", leases.len()); + + // Dump existing neighbours and register them + println!("dumping neighbours"); + if let Ok(neighbours) = dump_neighbours(handle.clone(), private_subnet).await { + for neigh in &neighbours { + println!("{:?}", neigh); + if !is_multicast_or_broadcast(neigh) { + process_new_neigh(neigh, &updater, &leases).await; + } + } + } + println!(); + + let (mut conn, mut _handle, mut messages) = + new_connection().map_err(|e| format!("{e}")).unwrap(); + + let groups = nl_mgrp(RTNLGRP_NEIGH); + + let addr = SocketAddr::new(0, groups); + conn.socket_mut() + .socket_mut() + .bind(&addr) + .expect("Failed to bind"); + + tokio::spawn(conn); + + let mut event_count: u64 = 0; + + // Start receiving events through `messages` channel. + while let Some((message, _)) = messages.next().await { + // Refresh leases periodically (every 50 events) + event_count += 1; + if event_count % 50 == 0 { + if let Ok(new_leases) = op::get_lease() { + leases = new_leases; + println!("refreshed {} DHCP leases", leases.len()); + } + } + + let payload = message.payload; + if let NetlinkPayload::InnerMessage(msg) = payload { + match msg { + RouteNetlinkMessage::NewNeighbour(new_neigh) => { + let Some(neigh) = parse_neighbour_message(new_neigh, private_subnet) else { + continue; + }; + if is_multicast_or_broadcast(&neigh) { + continue; + } + println!("New neighbour: {:?}", neigh); + process_new_neigh(&neigh, &updater, &leases).await; + } + RouteNetlinkMessage::DelNeighbour(del_neigh) => { + let Some(neigh) = parse_neighbour_message(del_neigh, private_subnet) else { + continue; + }; + if is_multicast_or_broadcast(&neigh) { + continue; + } + println!("Del neighbour: {:?}", neigh); + process_del_neigh(&neigh, &updater, &leases).await; + } + _ => {} + } + } + } + Ok(()) +} + +fn format_mac(mac: Vec) -> String { + let mut mac_str = String::new(); + for byte in mac { + mac_str.push_str(&format!("{:02x}:", byte)); + } + mac_str.pop(); + mac_str +} + +async fn dump_addresses(handle: Handle, link: Option) -> Result<(), Error> { + let mut request = handle.link().get(); + if let Some(link) = link { + request = request.match_name(link); + } + + let mut links = request.execute(); + if let Some(link) = links.try_next().await? { + let mut addresses = handle + .address() + .get() + .set_link_index_filter(link.header.index) + .execute(); + while let Some(msg) = addresses.try_next().await? { + println!("{msg:?}"); + } + Ok(()) + } else { + eprintln!("link not found"); + Ok(()) + } +} + +fn parse_neighbour_message(neigh: NeighbourMessage, private_subnet: bool) -> Option { + let state = neigh.header.state; + if state == NeighbourState::Permanent { + return None; + } + let addr: NeighbourAddress = neigh.attributes.iter().find_map(|attr| match attr { + NeighbourAttribute::Destination(inet) => Some(inet.to_owned()), + _ => None, + })?; + if private_subnet { + match addr { + NeighbourAddress::Inet(addr) => { + if !if_ipv4_in_private_subnet(&addr) { + return None; + } + } + NeighbourAddress::Inet6(addr) => { + if !if_ipv6_in_private_subnet(&addr) { + return None; + } + } + _ => {} + } + }; + let kind = neigh.header.kind; + let ifindex = neigh.header.ifindex; + let mac = neigh.attributes.iter().find_map(|attr| match attr { + NeighbourAttribute::LinkLocalAddress(mac) => Some(mac.to_owned()), + _ => None, + })?; + Some(Neigh { + ifindex, + state, + kind, + inet: addr, + mac: format_mac(mac), + }) +} + +async fn dump_neighbours(handle: Handle, private_subnet: bool) -> Result, Error> { + let mut neighbours = handle.neighbours().get().execute(); + let mut vec: Vec = Vec::new(); + while let Some(route) = neighbours.try_next().await? { + if let Some(neigh) = parse_neighbour_message(route, private_subnet) { + if !is_multicast_or_broadcast(&neigh) { + vec.push(neigh); + } + } + } + Ok(vec) +} diff --git a/ipv6-neigh/src/op.rs b/ipv6-neigh/src/op.rs new file mode 100644 index 00000000..a483cdd5 --- /dev/null +++ b/ipv6-neigh/src/op.rs @@ -0,0 +1,39 @@ +use serde_json::Value; +use std::collections::HashMap; +use std::path::Path; + +pub fn call_ubus(obj_path: &str, method: &str) -> Result> { + let socket = Path::new("/var/run/ubus/ubus.sock"); + + let mut connection = match ubus::Connection::connect(&socket) { + Ok(connection) => connection, + Err(err) => { + return Err(Box::new(err)); + } + }; + + let json = connection.call(obj_path, method, "").unwrap(); + let parsed: Value = serde_json::from_str(&json).unwrap(); + Ok(parsed) +} + +// get mac to hostname mapping +pub fn get_lease() -> Result, Box> { + // dhcpv6 does not use mac address, so we only need to get ipv4 leases + let ip4lease = call_ubus("dhcp", "ipv4leases"); + let leases = ip4lease.unwrap(); + let devices = leases["device"].as_object().unwrap(); + let mut result = HashMap::new(); + // hard code + for (device, leases) in devices { + let suffix = if device == "phy1-ap0" { ".iot" } else { ".lan" }; + let leases = leases["leases"].as_array().unwrap(); + for lease in leases { + let mac = lease["mac"].as_str().unwrap().to_string(); + let hostname = lease["hostname"].as_str().unwrap().to_string() + suffix; + result.insert(mac, hostname); + } + } + + Ok(result) +} diff --git a/luci-app-amlogic/Makefile b/luci-app-amlogic/Makefile index b3831ea3..04ea128c 100644 --- a/luci-app-amlogic/Makefile +++ b/luci-app-amlogic/Makefile @@ -16,8 +16,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-amlogic -PKG_VERSION:=3.1.289 -PKG_RELEASE:=4 +PKG_VERSION:=3.1.290 +PKG_RELEASE:=5 PKG_LICENSE:=GPL-2.0 License PKG_MAINTAINER:=ophub diff --git a/luci-app-amlogic/root/usr/sbin/openwrt-kernel b/luci-app-amlogic/root/usr/sbin/openwrt-kernel index 350c4b3d..eddbdc98 100755 --- a/luci-app-amlogic/root/usr/sbin/openwrt-kernel +++ b/luci-app-amlogic/root/usr/sbin/openwrt-kernel @@ -283,8 +283,8 @@ update_kernel() { rm -f /boot/uInitrd* else valid_files="vmlinuz-${kernel_name} uInitrd-${kernel_name} config-${kernel_name} System.map-${kernel_name}" - # wxy-oect: MODEL_ID numbers r304,r306 and w[0-9]{3}, require special handling of uInitrd - [[ "${MODEL_ID}" =~ ^(r304|r306|w[0-9]{3})$ ]] || rm -f /boot/initrd.img* + # wxy-oect: MODEL_ID numbers r306,r307 and w[0-9]{3}, require special handling of uInitrd + [[ "${MODEL_ID}" =~ ^(r306|r307|w[0-9]{3})$ ]] || rm -f /boot/initrd.img* fi for f in ${valid_files}; do [[ -f "/boot/${f}" ]] || restore_kernel; done @@ -304,8 +304,8 @@ update_kernel() { ln -sf vmlinuz-${kernel_name} ${MYBOOT_VMLINUZ} fi - # wxy-oect: MODEL_ID numbers r304 and r306, require special handling of uInitrd - [[ "${MODEL_ID}" =~ ^(r304|r306)$ ]] && ln -sf initrd.img-${kernel_name} uInitrd + # wxy-oect: MODEL_ID numbers r306 and r307, require special handling of uInitrd + [[ "${MODEL_ID}" =~ ^(r306|r307)$ ]] && ln -sf initrd.img-${kernel_name} uInitrd ) echo -e "(1/3) Unpacking [ boot-${kernel_name}.tar.gz ] done." diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile index d95ad933..26d2aa8b 100644 --- a/luci-app-passwall/Makefile +++ b/luci-app-passwall/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall PKG_VERSION:=26.4.15 -PKG_RELEASE:=100 +PKG_RELEASE:=101 PKG_PO_VERSION:=$(PKG_VERSION) PKG_CONFIG_DEPENDS:= \ diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua index a160fffe..baa06527 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/type/ray.lua @@ -401,13 +401,6 @@ o.validate = function(self, value) return api.trim(value:gsub("[\r\n]", "")) end -o = s:option(ListValue, _n("ech_ForceQuery"), translate("ECH Query Policy"), translate("Controls the policy used when performing DNS queries for ECH configuration.")) -o.default = "full" -o:value("none") -o:value("half") -o:value("full") -o:depends({ [_n("ech")] = true }) - -- [[ REALITY部分 ]] -- o = s:option(Value, _n("reality_publicKey"), translate("Public Key")) o:depends({ [_n("tls")] = true, [_n("reality")] = true }) diff --git a/luci-app-passwall/luasrc/passwall/util_xray.lua b/luci-app-passwall/luasrc/passwall/util_xray.lua index 4c017f21..d578aa2d 100644 --- a/luci-app-passwall/luasrc/passwall/util_xray.lua +++ b/luci-app-passwall/luasrc/passwall/util_xray.lua @@ -163,8 +163,7 @@ function gen_outbound(flag, node, tag, proxy_table) if not node.tls_CertByName then return "" end return node.tls_CertByName end)(), - echConfigList = (node.ech == "1") and node.ech_config or nil, - echForceQuery = (node.ech == "1") and (node.ech_ForceQuery or "full") or nil + echConfigList = (node.ech == "1") and node.ech_config or nil } or nil, realitySettings = (node.stream_security == "reality") and { serverName = node.tls_serverName, diff --git a/luci-app-passwall/po/zh-cn/passwall.po b/luci-app-passwall/po/zh-cn/passwall.po index 105d0c4e..a73a666a 100644 --- a/luci-app-passwall/po/zh-cn/passwall.po +++ b/luci-app-passwall/po/zh-cn/passwall.po @@ -1909,12 +1909,6 @@ msgstr "ECH 配置" msgid "ECH Key" msgstr "ECH 密钥" -msgid "ECH Query Policy" -msgstr "ECH 查询策略" - -msgid "Controls the policy used when performing DNS queries for ECH configuration." -msgstr "控制使用 DNS 查询 ECH 配置时的策略。" - msgid "ECH Query Domain" msgstr "ECH 查询域名" diff --git a/luci-app-passwall/root/usr/share/passwall/iptables.sh b/luci-app-passwall/root/usr/share/passwall/iptables.sh index 4e929926..81500ca0 100755 --- a/luci-app-passwall/root/usr/share/passwall/iptables.sh +++ b/luci-app-passwall/root/usr/share/passwall/iptables.sh @@ -939,13 +939,8 @@ add_firewall_rule() { fi } - ipset -! -R <<-EOF - $(ip address show | grep -w "inet" | awk '{print $2}' | awk -F '/' '{print $1}' | sed -e "s/^/add $IPSET_LOCAL /") - EOF - - ipset -! -R <<-EOF - $(ip address show | grep -w "inet6" | awk '{print $2}' | awk -F '/' '{print $1}' | sed -e "s/^/add $IPSET_LOCAL6 /") - EOF + get_local_ips ip4 | sed "s/^/add $IPSET_LOCAL /" | ipset -! -R + get_local_ips ip6 | sed "s/^/add $IPSET_LOCAL6 /" | ipset -! -R #局域网IP列表 ipset -! -R <<-EOF @@ -1023,9 +1018,9 @@ add_firewall_rule() { $ipt_n -N PSW_DNS if [ $(config_t_get global dns_redirect "1") = "0" ]; then #Only hijack when dest address is local IP - $ipt_n -I PREROUTING $(dst $IPSET_LOCAL) -j PSW_DNS + $ipt_n -I PREROUTING -m set --match-set $IPSET_LAN src $(dst $IPSET_LOCAL) -j PSW_DNS else - $ipt_n -I PREROUTING 1 -j PSW_DNS + $ipt_n -I PREROUTING -m set --match-set $IPSET_LAN src -j PSW_DNS fi $ipt_m -N PSW_DIVERT @@ -1094,9 +1089,9 @@ add_firewall_rule() { $ip6t_n -N PSW_DNS if [ $(config_t_get global dns_redirect "1") = "0" ]; then #Only hijack when dest address is local IP - $ip6t_n -I PREROUTING $(dst $IPSET_LOCAL6) -j PSW_DNS + $ip6t_n -I PREROUTING -m set --match-set $IPSET_LAN6 src $(dst $IPSET_LOCAL6) -j PSW_DNS else - $ip6t_n -I PREROUTING 1 -j PSW_DNS + $ip6t_n -I PREROUTING -m set --match-set $IPSET_LAN6 src -j PSW_DNS fi $ip6t_m -N PSW_DIVERT diff --git a/luci-app-passwall/root/usr/share/passwall/nftables.sh b/luci-app-passwall/root/usr/share/passwall/nftables.sh index ce413be1..3929f7bd 100755 --- a/luci-app-passwall/root/usr/share/passwall/nftables.sh +++ b/luci-app-passwall/root/usr/share/passwall/nftables.sh @@ -1011,8 +1011,8 @@ add_firewall_rule() { fi } - ip address show | grep -w "inet" | awk '{print $2}' | awk -F '/' '{print $1}' | insert_nftset $NFTSET_LOCAL "-1" - ip address show | grep -w "inet6" | awk '{print $2}' | awk -F '/' '{print $1}' | insert_nftset $NFTSET_LOCAL6 "-1" + get_local_ips ip4 | insert_nftset $NFTSET_LOCAL "-1" + get_local_ips ip6 | insert_nftset $NFTSET_LOCAL6 "-1" # 忽略特殊IP段 local lan_ifname lan_ip @@ -1074,10 +1074,11 @@ add_firewall_rule() { nft "flush chain $NFTABLE_NAME PSW_DNS" if [ $(config_t_get global dns_redirect "1") = "0" ]; then #Only hijack when dest address is local IP - nft "insert rule $NFTABLE_NAME dstnat ip daddr @${NFTSET_LOCAL} jump PSW_DNS" - nft "insert rule $NFTABLE_NAME dstnat ip6 daddr @${NFTSET_LOCAL6} jump PSW_DNS" + nft "insert rule $NFTABLE_NAME dstnat ip saddr @${NFTSET_LAN} ip daddr @${NFTSET_LOCAL} jump PSW_DNS" + nft "insert rule $NFTABLE_NAME dstnat ip6 saddr @${NFTSET_LAN6} ip6 daddr @${NFTSET_LOCAL6} jump PSW_DNS" else - nft "insert rule $NFTABLE_NAME dstnat jump PSW_DNS" + nft "insert rule $NFTABLE_NAME dstnat ip saddr @${NFTSET_LAN} jump PSW_DNS" + nft "insert rule $NFTABLE_NAME dstnat ip6 saddr @${NFTSET_LAN6} jump PSW_DNS" fi # for ipv4 ipv6 tproxy mark diff --git a/luci-app-passwall/root/usr/share/passwall/utils.sh b/luci-app-passwall/root/usr/share/passwall/utils.sh index 75ee442f..f56345a6 100755 --- a/luci-app-passwall/root/usr/share/passwall/utils.sh +++ b/luci-app-passwall/root/usr/share/passwall/utils.sh @@ -518,3 +518,33 @@ get_wan_ips() { done echo "$NET_ADDR" } + +get_local_ips() { + local family="$1" + local ALL_IPS WAN_IPS ip NET_ADDR + if [ "$family" = "ip6" ]; then + ALL_IPS=$(ip -o -6 addr show scope global | awk '{print $4}' | cut -d/ -f1) + WAN_IPS=$(get_wan_ips ip6) + else + ALL_IPS=$(ip -o -4 addr show scope global | awk '{print $4}' | cut -d/ -f1) + WAN_IPS=$(get_wan_ips ip4) + fi + # 补充回环(scope global 不包含) + [ "$family" = "ip6" ] && ALL_IPS="$ALL_IPS ::1" + [ "$family" != "ip6" ] && ALL_IPS="$ALL_IPS 127.0.0.1" + for ip in $ALL_IPS; do + case "$ip" in + ""|0.0.0.0|::) continue ;; + esac + case " $WAN_IPS " in + *" $ip "*) continue ;; + esac + case " $NET_ADDR " in + *" $ip "*) ;; + *) NET_ADDR="${NET_ADDR:+$NET_ADDR }$ip" ;; + esac + done + for ip in $NET_ADDR; do + echo "$ip" + done +} diff --git a/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js b/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js index 0e46558e..11db0cf0 100644 --- a/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js +++ b/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js @@ -46,6 +46,16 @@ function pushUnique(list, value) { list.push(value); } +function mergeUniqueValues(...lists) { + const merged = []; + + for (const list of lists) + for (const value of L.toArray(list)) + pushUnique(merged, value); + + return merged; +} + function getQcaFallbackIfname(device, section) { if (/^ath\d+$/.test(String(section || ''))) return section; @@ -1541,7 +1551,9 @@ var CBIWifiFrequencyValue = form.Value.extend({ const statuscfg = L.isObject(wstatus[device_section]?.config) ? wstatus[device_section].config : {}; const devcfg = { channel: statuscfg.channel ?? (wifidevs ? wifidevs.ubus('dev', 'config', 'channel') : null), - band: statuscfg.band ?? (wifidevs ? wifidevs.ubus('dev', 'config', 'band') : null) + band: statuscfg.band ?? (wifidevs ? wifidevs.ubus('dev', 'config', 'band') : null), + hwmode: statuscfg.hwmode ?? (wifidevs ? wifidevs.ubus('dev', 'config', 'hwmode') : null), + htmode: statuscfg.htmode ?? (wifidevs ? wifidevs.ubus('dev', 'config', 'htmode') : null) }; this.devinfo = devinfo; @@ -1592,8 +1604,19 @@ var CBIWifiFrequencyValue = form.Value.extend({ return Array.isArray(channels) && (channels.length > offset || (configured_band == band && channels.length > 0)); }; - let hwmode_values = L.toArray(wifidevs ? wifidevs.getHWModes() : null); - let htmode_values = L.toArray(wifidevs ? wifidevs.getHTModes() : null); + const merge_mode_sources = (hwtype == 'mac80211'); + let hwmode_values = merge_mode_sources + ? mergeUniqueValues( + wifidevs ? wifidevs.getHWModes() : null, + devinfo.hwmodes + ) + : L.toArray(wifidevs ? wifidevs.getHWModes() : null); + let htmode_values = merge_mode_sources + ? mergeUniqueValues( + wifidevs ? wifidevs.getHTModes() : null, + devinfo.htmodes + ) + : L.toArray(wifidevs ? wifidevs.getHTModes() : null); if (!hwmode_values.length) hwmode_values = L.toArray(devinfo.hwmodes); @@ -1959,8 +1982,8 @@ var CBIWifiFrequencyValue = form.Value.extend({ const config_chval = cfgvals ? cfgvals[2] : uci.get('wireless', config_section, 'channel'); const cfg_chval = devcfg.channel || config_chval; const cfg_bandval = devcfg.band || uci.get('wireless', config_section, 'band'); - const htval = isQcaWifiHwtype(hwtype) ? (cfg_htval || devinfo.htmode) : (devinfo.htmode || cfg_htval); - const hwval = isQcaWifiHwtype(hwtype) ? (cfg_hwval || devinfo.hwmode) : (devinfo.hwmode || cfg_hwval); + const htval = cfg_htval || devcfg.htmode || devinfo.htmode; + const hwval = cfg_hwval || devcfg.hwmode || devinfo.hwmode; const chval = cfg_chval || devinfo.channel; const bandval = cfg_bandval || getConfiguredBand(hwtype, hwval, chval, null, htval); const forceSelectValue = function(sel, value) {