diff --git a/Cargo.lock b/Cargo.lock index 61a3f3a..535a295 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,7 +23,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom", + "getrandom 0.2.14", "once_cell", "version_check", ] @@ -35,7 +35,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom", + "getrandom 0.2.14", "once_cell", "serde", "version_check", @@ -177,7 +177,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.111", ] [[package]] @@ -188,7 +188,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.111", ] [[package]] @@ -293,12 +293,6 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" -[[package]] -name = "base64" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea22880d78093b0cbe17c89f64a7d457941e65759157ec6cb31a31d652b05e5" - [[package]] name = "base64" version = "0.21.7" @@ -532,7 +526,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.111", ] [[package]] @@ -559,7 +553,7 @@ dependencies = [ "hex", "pest", "pest_derive", - "thiserror", + "thiserror 1.0.59", ] [[package]] @@ -592,19 +586,19 @@ name = "config" version = "0.1.0" dependencies = [ "anyhow", - "base64 0.21.7", + "base64 0.22.1", "client-classification", "dora-core", "hex", "ipnet", "phf", - "rand", + "rand 0.8.5", + "rustls-pki-types", "serde", "serde_json", "serde_yaml", "topo_sort", "tracing", - "trust-dns-proto 0.22.0", ] [[package]] @@ -683,6 +677,12 @@ dependencies = [ "itertools", ] +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + [[package]] name = "crossbeam-channel" version = "0.5.12" @@ -800,15 +800,13 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" name = "ddns" version = "0.1.0" dependencies = [ - "base64 0.20.0", + "base64 0.22.1", "config", "dora-core", "hex", - "ipnet", - "rand", + "rand 0.8.5", "ring 0.16.20", - "thiserror", - "trust-dns-client", + "thiserror 1.0.59", ] [[package]] @@ -862,24 +860,27 @@ dependencies = [ [[package]] name = "dhcproto" -version = "0.11.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "000717b4f6913807b6195419e0bacb008d449ba6023ca26abf349c4ff2f1866b" +checksum = "425ab19f6a915beac79cac8ec2810c1311b502ae14d7f294682081cf5ae4c5bb" dependencies = [ "dhcproto-macros", - "hex", + "hickory-proto", "ipnet", - "rand", - "thiserror", - "trust-dns-proto 0.22.0", - "url", + "rand 0.9.2", + "thiserror 2.0.17", ] [[package]] name = "dhcproto-macros" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7993efb860416547839c115490d4951c6d0f8ec04a3594d9dd99d50ed7ec170" +checksum = "3944d18b1889ce23702b0ea0230e87033cf5b4659e233419b5c00da3983a387b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] [[package]] name = "digest" @@ -896,7 +897,18 @@ name = "discovery" version = "0.1.0" dependencies = [ "anyhow", - "trust-dns-resolver", + "hickory-resolver", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", ] [[package]] @@ -915,7 +927,7 @@ dependencies = [ "leases", "mac_address", "message-type", - "rand", + "rand 0.8.5", "socket2 0.5.6", "static-addr", "tokio-util", @@ -949,15 +961,15 @@ dependencies = [ "dhcproto", "env-parser", "futures", + "hickory-proto", "lazy_static", "libc", "pin-project", "pnet", "prometheus", "prometheus-static-metric", - "rand", + "rand 0.8.5", "socket2 0.5.6", - "thiserror", "tokio", "tokio-stream", "tokio-test", @@ -966,7 +978,6 @@ dependencies = [ "tracing", "tracing-futures", "tracing-subscriber", - "trust-dns-proto 0.22.0", "unix-udp-sock", ] @@ -994,34 +1005,16 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "endian-type" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" - [[package]] name = "enum-as-inner" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "570d109b813e904becc80d8d5da38376818a143348413f7149f1340fe04754d4" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "enum-as-inner" -version = "0.5.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.111", ] [[package]] @@ -1137,9 +1130,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] @@ -1236,7 +1229,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.111", ] [[package]] @@ -1275,6 +1268,20 @@ dependencies = [ "slab", ] +[[package]] +name = "generator" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "605183a538e3e2a9c1038635cc5c2d194e2ee8fd0d1b66b8349fad7dbacce5a2" +dependencies = [ + "cc", + "cfg-if", + "libc", + "log", + "rustversion", + "windows", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1296,6 +1303,18 @@ dependencies = [ "wasi 0.11.0+wasi-snapshot-preview1", ] +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasip2", +] + [[package]] name = "gimli" version = "0.28.1" @@ -1322,7 +1341,7 @@ dependencies = [ "nonzero_ext", "parking_lot 0.12.1", "quanta 0.9.3", - "rand", + "rand 0.8.5", "smallvec", ] @@ -1421,6 +1440,56 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hickory-proto" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8a6fe56c0038198998a6f217ca4e7ef3a5e51f46163bd6dd60b5c71ca6c6502" +dependencies = [ + "async-trait", + "bitflags 2.5.0", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "idna", + "ipnet", + "once_cell", + "rand 0.9.2", + "ring 0.17.8", + "rustls-pki-types", + "serde", + "thiserror 2.0.17", + "time", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "hickory-resolver" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc62a9a99b0bfb44d2ab95a7208ac952d31060efc16241c87eaf36406fecf87a" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-proto", + "ipconfig", + "moka 0.12.10", + "once_cell", + "parking_lot 0.12.1", + "rand 0.9.2", + "resolv-conf", + "smallvec", + "thiserror 2.0.17", + "tokio", + "tracing", +] + [[package]] name = "hostname" version = "0.3.1" @@ -1592,7 +1661,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -1611,15 +1680,96 @@ dependencies = [ "dora-core", "parking_lot 0.12.1", "pnet", - "rand", + "rand 0.8.5", "socket2 0.5.6", - "thiserror", + "thiserror 1.0.59", "tokio", "tracing", "tracing-subscriber", "tracing-test", ] +[[package]] +name = "icu_collections" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" + +[[package]] +name = "icu_properties" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e93fcd3157766c0c8da2f8cff6ce651a31f0810eaa1c51ec363ef790bbb5fb99" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02845b3647bb045f1100ecd6480ff52f34c35f82d9880e029d329c21d1054899" + +[[package]] +name = "icu_provider" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1628,23 +1778,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.2.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", ] [[package]] -name = "idna" -version = "0.5.0" +name = "idna_adapter" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", ] [[package]] @@ -1697,10 +1847,10 @@ dependencies = [ "config", "icmp-ping", "ipnet", - "moka", - "rand", + "moka 0.10.4", + "rand 0.8.5", "sqlx", - "thiserror", + "thiserror 1.0.59", "tokio", "tokio-test", "tracing", @@ -1709,14 +1859,14 @@ dependencies = [ [[package]] name = "ipconfig" -version = "0.2.2" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7" +checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.3.19", + "socket2 0.5.6", "widestring", - "winapi", - "winreg 0.6.2", + "windows-sys 0.48.0", + "winreg 0.50.0", ] [[package]] @@ -1844,9 +1994,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.177" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" [[package]] name = "libsqlite3-sys" @@ -1877,6 +2027,12 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +[[package]] +name = "litemap" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" + [[package]] name = "lock_api" version = "0.4.11" @@ -1894,12 +2050,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] -name = "lru-cache" -version = "0.1.2" +name = "loom" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" dependencies = [ - "linked-hash-map", + "cfg-if", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", ] [[package]] @@ -1945,12 +2105,6 @@ dependencies = [ "regex-automata 0.1.10", ] -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - [[package]] name = "matchit" version = "0.7.3" @@ -2037,18 +2191,28 @@ dependencies = [ "skeptic", "smallvec", "tagptr", - "thiserror", + "thiserror 1.0.59", "triomphe", "uuid", ] [[package]] -name = "nibble_vec" -version = "0.1.0" +name = "moka" +version = "0.12.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" +checksum = "a9321642ca94a4282428e6ea4af8cc2ca4eac48ac7a6a4ea8f33f76d0ce70926" dependencies = [ + "crossbeam-channel", + "crossbeam-epoch", + "crossbeam-utils", + "loom", + "parking_lot 0.12.1", + "portable-atomic", + "rustc_version", "smallvec", + "tagptr", + "thiserror 1.0.59", + "uuid", ] [[package]] @@ -2210,9 +2374,13 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +dependencies = [ + "critical-section", + "portable-atomic", +] [[package]] name = "oorandom" @@ -2303,9 +2471,9 @@ checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "pest" @@ -2314,7 +2482,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.59", "ucd-trie", ] @@ -2338,7 +2506,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.111", ] [[package]] @@ -2379,7 +2547,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ "phf_shared", - "rand", + "rand 0.8.5", ] [[package]] @@ -2392,7 +2560,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.111", ] [[package]] @@ -2422,7 +2590,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.111", ] [[package]] @@ -2518,7 +2686,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.60", + "syn 2.0.111", ] [[package]] @@ -2580,6 +2748,21 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "portable-atomic" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" + +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -2594,9 +2777,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" dependencies = [ "unicode-ident", ] @@ -2613,7 +2796,7 @@ dependencies = [ "memchr", "parking_lot 0.12.1", "protobuf", - "thiserror", + "thiserror 1.0.59", ] [[package]] @@ -2693,14 +2876,10 @@ dependencies = [ ] [[package]] -name = "radix_trie" -version = "0.2.1" +name = "r-efi" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" -dependencies = [ - "endian-type", - "nibble_vec", -] +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rand" @@ -2709,8 +2888,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", ] [[package]] @@ -2720,7 +2909,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", ] [[package]] @@ -2729,7 +2928,16 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.14", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.4", ] [[package]] @@ -2951,7 +3159,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.14", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -3039,9 +3247,12 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "708c0f9d5f54ba0272468c1d306a52c495b31fa155e91bc25371e6df7996908c" +dependencies = [ + "zeroize", +] [[package]] name = "rustls-webpki" @@ -3084,6 +3295,12 @@ dependencies = [ "parking_lot 0.12.1", ] +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.2.0" @@ -3126,7 +3343,7 @@ checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.111", ] [[package]] @@ -3239,17 +3456,6 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -[[package]] -name = "socket2" -version = "0.3.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" -dependencies = [ - "cfg-if", - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.4.10" @@ -3346,7 +3552,7 @@ dependencies = [ "sqlformat", "sqlx-rt", "stringprep", - "thiserror", + "thiserror 1.0.59", "tokio-stream", "url", "webpki", @@ -3386,6 +3592,12 @@ dependencies = [ "tokio-rustls 0.22.0", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + [[package]] name = "static-addr" version = "0.1.0" @@ -3441,9 +3653,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.60" +version = "2.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87" dependencies = [ "proc-macro2", "quote", @@ -3462,6 +3674,17 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -3513,7 +3736,16 @@ version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.59", +] + +[[package]] +name = "thiserror" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +dependencies = [ + "thiserror-impl 2.0.17", ] [[package]] @@ -3524,7 +3756,18 @@ checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.111", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", ] [[package]] @@ -3567,6 +3810,16 @@ dependencies = [ "time-core", ] +[[package]] +name = "tinystr" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -3619,7 +3872,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.111", ] [[package]] @@ -3686,7 +3939,7 @@ dependencies = [ name = "topo_sort" version = "0.1.0" dependencies = [ - "thiserror", + "thiserror 1.0.59", ] [[package]] @@ -3754,7 +4007,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.111", ] [[package]] @@ -3848,99 +4101,6 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" -[[package]] -name = "trust-dns-client" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c408c32e6a9dbb38037cece35740f2cf23c875d8ca134d33631cec83f74d3fe" -dependencies = [ - "cfg-if", - "data-encoding", - "futures-channel", - "futures-util", - "lazy_static", - "radix_trie", - "rand", - "ring 0.16.20", - "thiserror", - "time", - "tokio", - "tracing", - "trust-dns-proto 0.22.0", -] - -[[package]] -name = "trust-dns-proto" -version = "0.20.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca94d4e9feb6a181c690c4040d7a24ef34018d8313ac5044a61d21222ae24e31" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner 0.3.4", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.2.3", - "ipnet", - "lazy_static", - "log", - "rand", - "smallvec", - "thiserror", - "tinyvec", - "tokio", - "url", -] - -[[package]] -name = "trust-dns-proto" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner 0.5.1", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.2.3", - "ipnet", - "lazy_static", - "rand", - "ring 0.16.20", - "serde", - "smallvec", - "thiserror", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.20.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecae383baad9995efaa34ce8e57d12c3f305e545887472a492b838f4b5cfb77a" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lazy_static", - "log", - "lru-cache", - "parking_lot 0.11.2", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "trust-dns-proto 0.20.4", -] - [[package]] name = "try-lock" version = "0.2.5" @@ -4041,16 +4201,22 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "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 = "utf8parse" version = "0.2.1" @@ -4063,7 +4229,7 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ - "getrandom", + "getrandom 0.2.14", ] [[package]] @@ -4121,6 +4287,15 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasip2" +version = "1.0.1+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +dependencies = [ + "wit-bindgen", +] + [[package]] name = "wasm-bindgen" version = "0.2.92" @@ -4142,7 +4317,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.111", "wasm-bindgen-shared", ] @@ -4176,7 +4351,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.111", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4227,9 +4402,9 @@ dependencies = [ [[package]] name = "widestring" -version = "0.4.3" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" +checksum = "72069c3113ab32ab29e5584db3c6ec55d416895e60715417b5b883a357c3e471" [[package]] name = "winapi" @@ -4262,6 +4437,28 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.61.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +dependencies = [ + "windows-collections", + "windows-core 0.61.2", + "windows-future", + "windows-link", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core 0.61.2", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -4271,6 +4468,86 @@ dependencies = [ "windows-targets 0.52.5", ] +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-future" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +dependencies = [ + "windows-core 0.61.2", + "windows-link", + "windows-threading", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core 0.61.2", + "windows-link", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -4320,6 +4597,15 @@ dependencies = [ "windows_x86_64_msvc 0.52.5", ] +[[package]] +name = "windows-threading" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +dependencies = [ + "windows-link", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -4410,15 +4696,6 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" -[[package]] -name = "winreg" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" -dependencies = [ - "winapi", -] - [[package]] name = "winreg" version = "0.50.0" @@ -4439,6 +4716,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "wit-bindgen" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" + +[[package]] +name = "writeable" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" + [[package]] name = "yaml-rust" version = "0.4.5" @@ -4448,6 +4737,29 @@ dependencies = [ "linked-hash-map", ] +[[package]] +name = "yoke" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.32" @@ -4465,7 +4777,28 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.111", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", + "synstructure", ] [[package]] @@ -4473,3 +4806,36 @@ name = "zeroize" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" + +[[package]] +name = "zerotrie" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.111", +] diff --git a/Cargo.toml b/Cargo.toml index c3c45e9..a4c42df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,9 +16,9 @@ resolver = "2" # default-members = ["bin"] [workspace.dependencies] -trust-dns-proto = { version = "0.22.0", default-features = false, features = [ - "dnssec", - "serde-config", +hickory-proto = { version = "0.25.2", default-features = false, features = [ + "dnssec-ring", + "serde", ] } socket2 = { version = "0.5.6", features = [ "all", @@ -27,7 +27,8 @@ anyhow = { version = "1.0", features = ["backtrace"] } async-trait = "0.1" bytes = "1.1" clap = { version = "4.5.4", features = ["derive", "env"] } -dhcproto = "0.11.0" +base64 = "0.22.1" +dhcproto = "0.14.0" futures = { version = "0.3", default-features = false, features = ["std"] } ipnet = { features = ["serde"], version = "2.4.0" } pnet = { features = ["serde", "std"], version = "0.34.0" } @@ -43,3 +44,4 @@ rand = "0.8.5" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" serde_yaml = "0.8" +rustls-pki-types = "1.13.1" \ No newline at end of file diff --git a/docs/ddns.md b/docs/ddns.md index b4a7551..1ef6e34 100644 --- a/docs/ddns.md +++ b/docs/ddns.md @@ -45,7 +45,7 @@ There are a few config values that can change the behavior of the update. These The logic for client FQDN flag handling is largely in the `handle_flags` function, and was translated from [Keas flag handling](https://github.com/isc-projects/kea/blob/9c76b9a9e55b49ea407531b64783f6ec12546f42/src/lib/dhcpsrv/d2_client_mgr.cc#L115) -As for the content of the DNS updates themselves, here is an example of a forward update created by trust-dns-client +As for the content of the DNS updates themselves, here is an example of a forward update created by hickory-dns-client ![fwd_update](https://user-images.githubusercontent.com/1128302/210460131-97bcf7f1-09aa-4c82-807f-7d5eb19542d3.png) diff --git a/dora-core/Cargo.toml b/dora-core/Cargo.toml index 082af17..36ce214 100644 --- a/dora-core/Cargo.toml +++ b/dora-core/Cargo.toml @@ -27,8 +27,7 @@ tokio-util = { workspace = true } tracing = { workspace = true } tracing-futures = { workspace = true } tracing-subscriber = { workspace = true } -thiserror = { workspace = true } -trust-dns-proto = { workspace = true } +hickory-proto = { workspace = true } pin-project = "1.0" prometheus = { workspace = true } prometheus-static-metric = { workspace = true } diff --git a/dora-core/src/lib.rs b/dora-core/src/lib.rs index ec219fc..b8ee44a 100644 --- a/dora-core/src/lib.rs +++ b/dora-core/src/lib.rs @@ -20,11 +20,11 @@ pub use async_trait::async_trait; pub use chrono; pub use chrono_tz; pub use dhcproto; +pub use hickory_proto; pub use pnet; pub use tokio; pub use tokio_stream; pub use tracing; -pub use trust_dns_proto; pub use unix_udp_sock; pub use crate::server::Server; diff --git a/dora-core/src/server/context.rs b/dora-core/src/server/context.rs index 10b406c..6064c1a 100644 --- a/dora-core/src/server/context.rs +++ b/dora-core/src/server/context.rs @@ -1,10 +1,4 @@ //! context of current server message -use chrono::{DateTime, Utc}; -use dhcproto::{Decodable, Decoder, Encodable, v4, v6}; -use pnet::ipnetwork::{IpNetwork, Ipv4Network, Ipv6Network}; -use tracing::{error, trace}; -use unix_udp_sock::RecvMeta; - use std::{ fmt, io::{self, Error, ErrorKind}, @@ -13,6 +7,12 @@ use std::{ time::Duration, }; +use chrono::{DateTime, Utc}; +use dhcproto::{Decodable, Decoder, Encodable, v4, v6}; +use pnet::ipnetwork::{IpNetwork, Ipv4Network, Ipv6Network}; +use tracing::{error, trace}; +use unix_udp_sock::RecvMeta; + use crate::{ metrics::{self, RECV_TYPE_COUNT, SENT_TYPE_COUNT, V6_RECV_TYPE_COUNT, V6_SENT_TYPE_COUNT}, server::{State, msg::SerialMsg, typemap::TypeMap}, @@ -552,10 +552,10 @@ impl MsgContext { .opts() .get(OptionCode::RelayAgentInformation) .and_then(|opt| { - if let DhcpOption::RelayAgentInformation(info) = opt { - if let Some(RelayInfo::LinkSelection(ip)) = info.get(RelayCode::LinkSelection) { - return Some(ip); - } + if let DhcpOption::RelayAgentInformation(info) = opt + && let Some(RelayInfo::LinkSelection(ip)) = info.get(RelayCode::LinkSelection) + { + return Some(ip); } None }) @@ -644,11 +644,12 @@ impl MsgContext { self.msg.opts().get(OptionCode::ParameterRequestList) { // if broadcast addr is requested, try to fill from interface - if let Some(IpNetwork::V4(interface)) = self.interface { - if requested.contains(&v4::OptionCode::BroadcastAddr) && interface_match { - resp.opts_mut() - .insert(DhcpOption::BroadcastAddr(interface.broadcast())); - } + if let Some(IpNetwork::V4(interface)) = self.interface + && requested.contains(&v4::OptionCode::BroadcastAddr) + && interface_match + { + resp.opts_mut() + .insert(DhcpOption::BroadcastAddr(interface.broadcast())); } // look in the requested list of params for code in requested { diff --git a/external-api/Cargo.toml b/external-api/Cargo.toml index 2533617..d0ae102 100644 --- a/external-api/Cargo.toml +++ b/external-api/Cargo.toml @@ -30,7 +30,7 @@ ipnet = { workspace = true } [dev-dependencies] -reqwest = { version = "0.12", default-features = false, features = [ +reqwest = { version = "0.12.4", default-features = false, features = [ "json", "rustls-tls", ] } diff --git a/libs/config/Cargo.toml b/libs/config/Cargo.toml index 0687abd..a7920a4 100644 --- a/libs/config/Cargo.toml +++ b/libs/config/Cargo.toml @@ -8,16 +8,16 @@ license = "MPL-2.0" [dependencies] anyhow = { workspace = true } +base64 = { workspace = true } ipnet = { workspace = true } tracing = { workspace = true } serde_yaml = { workspace = true } serde_json = { workspace = true } serde = { workspace = true } -trust-dns-proto = { workspace = true } -base64 = "0.21.0" hex = "0.4" phf = { version = "0.11", features = ["macros"] } rand = "0.8" +rustls-pki-types = { workspace = true } dora-core = { path = "../../dora-core" } client-classification = { path = "../client-classification" } diff --git a/libs/config/src/v4.rs b/libs/config/src/v4.rs index 64d8e75..76728ce 100644 --- a/libs/config/src/v4.rs +++ b/libs/config/src/v4.rs @@ -419,10 +419,10 @@ impl Network { // skip matching on message type continue; } - if let Some(res) = self.get_reserved_opt(opt) { - if res.match_class(classes) { - return Some(res); - } + if let Some(res) = self.get_reserved_opt(opt) + && res.match_class(classes) + { + return Some(res); } } None diff --git a/libs/config/src/v6.rs b/libs/config/src/v6.rs index 2d90208..2e6cbe8 100644 --- a/libs/config/src/v6.rs +++ b/libs/config/src/v6.rs @@ -9,10 +9,7 @@ use std::{ use anyhow::{Context, bail}; use dora_core::{ anyhow::Result, - dhcproto::{ - v4::HType, - v6::{DhcpOptions, duid::Duid}, - }, + dhcproto::v6::{DhcpOptions, HType, duid::Duid}, pnet::ipnetwork::{IpNetwork, Ipv6Network}, pnet::{self, datalink::NetworkInterface}, }; @@ -194,8 +191,7 @@ pub fn generate_duid_from_config(server_id: &ServerDuidInfo, link_layer: Ipv6Add if htype == 0 { HType::Eth } else { - //TODO: This is a compromise of v4 HType. Should be changed to v6 HType after dhcproto is updated. - HType::from(htype as u8) + HType::from(htype) } } match server_id { diff --git a/libs/config/src/wire/v4.rs b/libs/config/src/wire/v4.rs index c9b890d..9a448f7 100644 --- a/libs/config/src/wire/v4.rs +++ b/libs/config/src/wire/v4.rs @@ -49,14 +49,14 @@ use dora_core::{ Decodable, Decoder, Encodable, Encoder, v4::{self, DhcpOption, DhcpOptions, OptionCode}, }, + hickory_proto::{ + rr::Name, + serialize::binary::{BinEncodable, BinEncoder}, + }, pnet::util::MacAddr, }; use serde::{Deserialize, Deserializer, Serialize, de}; use tracing::warn; -use trust_dns_proto::{ - rr, - serialize::binary::{BinEncodable, BinEncoder}, -}; use crate::wire::{MaybeList, MinMax}; @@ -263,7 +263,7 @@ fn write_opt(enc: &mut Encoder<'_>, code: u8, opt: Opt) -> anyhow::Result<()> { Opt::Domain(MaybeList::Val(domain)) => { let mut buf = Vec::new(); let mut name_encoder = BinEncoder::new(&mut buf); - let name = domain.parse::()?; + let name = domain.parse::()?; name.emit(&mut name_encoder)?; v4::encode_long_opt_bytes(OptionCode::from(code), &buf, enc)?; } @@ -272,7 +272,7 @@ fn write_opt(enc: &mut Encoder<'_>, code: u8, opt: Opt) -> anyhow::Result<()> { let mut buf = Vec::new(); let mut name_encoder = BinEncoder::new(&mut buf); for name in list { - let name = name.parse::()?; + let name = name.parse::()?; name.emit(&mut name_encoder)?; } v4::encode_long_opt_bytes(OptionCode::from(code), &buf, enc)?; @@ -498,8 +498,7 @@ pub mod ddns { use super::*; - use dora_core::dhcproto::Name; - pub use dora_core::trust_dns_proto::rr::dnssec::rdata::tsig::TsigAlgorithm; + use dora_core::{dhcproto::Name, hickory_proto::dnssec::rdata::tsig::TsigAlgorithm}; fn default_true() -> bool { true diff --git a/libs/config/src/wire/v6.rs b/libs/config/src/wire/v6.rs index 3f0ad56..7be6c9e 100644 --- a/libs/config/src/wire/v6.rs +++ b/libs/config/src/wire/v6.rs @@ -46,20 +46,15 @@ pub struct Net { pub authoritative: bool, } -#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)] +#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone, Default)] pub enum DuidType { + #[default] LLT, LL, EN, UUID, } -impl Default for DuidType { - fn default() -> Self { - Self::LLT - } -} - #[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)] #[serde(tag = "type")] pub enum ServerDuidInfo { diff --git a/libs/ddns/Cargo.toml b/libs/ddns/Cargo.toml index 1b105af..dd5240c 100644 --- a/libs/ddns/Cargo.toml +++ b/libs/ddns/Cargo.toml @@ -8,15 +8,12 @@ edition = "2024" [dependencies] dora-core = { path = "../../dora-core" } config = { path = "../config" } -trust-dns-client = { version = "0.22.0", features = ["dnssec-ring"] } +base64 = { workspace = true } thiserror = { workspace = true } ring = "0.16.20" hex = "0.4" rand = { workspace = true } -ipnet = { workspace = true } -[dev-dependencies] -base64 = "0.20" [[example]] name = "tsig" diff --git a/libs/ddns/examples/tsig.rs b/libs/ddns/examples/tsig.rs index e4e03c3..35cef05 100644 --- a/libs/ddns/examples/tsig.rs +++ b/libs/ddns/examples/tsig.rs @@ -1,6 +1,5 @@ use std::{fs::File, io::Read, str::FromStr}; -use config::wire::v4::ddns::TsigAlgorithm; use ddns::{ dhcid::{self, IdType}, update::Updater, @@ -9,10 +8,10 @@ use dora_core::{ anyhow::{self, Result}, config::trace, dhcproto::Name, + hickory_proto::dnssec::{rdata::tsig::TsigAlgorithm, tsig::TSigner}, tokio::{self}, tracing::{debug, error}, }; -use trust_dns_client::rr::dnssec::tsig::TSigner; #[tokio::main] async fn main() -> Result<()> { diff --git a/libs/ddns/src/dhcid.rs b/libs/ddns/src/dhcid.rs index 7ee9a45..27172eb 100644 --- a/libs/ddns/src/dhcid.rs +++ b/libs/ddns/src/dhcid.rs @@ -1,6 +1,9 @@ +use std::fmt; + +use base64::{Engine, prelude::BASE64_STANDARD}; use dora_core::dhcproto::{Name, NameError, v4::HType}; +use dora_core::hickory_proto::serialize::binary::BinEncoder; use ring::digest::{Context, SHA256}; -use trust_dns_client::serialize::binary::BinEncoder; #[derive(Debug, PartialEq, Eq, Clone)] pub struct DhcId { @@ -8,6 +11,15 @@ pub struct DhcId { id: Vec, } +impl fmt::Display for DhcId { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("DhcId") + .field("type", &self.ty) + .field("id", &BASE64_STANDARD.encode(&self.id)) + .finish() + } +} + impl DhcId { /// if created with type Chaddr, only significant bytes (up to hlen) should be provided pub fn new>>(ty: IdType, id: T) -> Self { @@ -98,6 +110,8 @@ pub enum IdType { mod tests { use std::str::FromStr; + use base64::{Engine, prelude::BASE64_STANDARD}; + use super::*; // A DHCP server allocates the IPv4 address 192.0.2.2 to a client that @@ -120,7 +134,7 @@ mod tests { .rdata(&Name::from_str("chi.example.com.").unwrap()) .unwrap(); assert_eq!( - base64::encode(out), + BASE64_STANDARD.encode(out), "AAEBOSD+XR3Os/0LozeXVqcNc7FwCfQdWL3b/NaiUDlW2No=".to_owned() ); } @@ -145,7 +159,7 @@ mod tests { .rdata(&Name::from_str("client.example.com.").unwrap()) .unwrap(); assert_eq!( - base64::encode(out), + BASE64_STANDARD.encode(out), "AAABxLmlskllE0MVjd57zHcWmEH3pCQ6VytcKD//7es/deY=".to_owned() ); } diff --git a/libs/ddns/src/lib.rs b/libs/ddns/src/lib.rs index 326ef1e..3912a53 100644 --- a/libs/ddns/src/lib.rs +++ b/libs/ddns/src/lib.rs @@ -1,8 +1,11 @@ #![allow(clippy::too_many_arguments)] +use std::time::Duration; use std::{net::Ipv4Addr, str::FromStr}; +use base64::{Engine, prelude::BASE64_STANDARD}; use config::v4::{Ddns, NetRange}; +use dora_core::tracing; use dora_core::{ dhcproto::{ Name, NameError, @@ -11,16 +14,15 @@ use dora_core::{ fqdn::{ClientFQDN, FqdnFlags}, }, }, + hickory_proto::{dnssec::DnsSecError, dnssec::tsig::TSigner}, prelude::MsgContext, - tracing::{debug, error, info}, + tracing::{debug, error, info, trace, warn}, }; -use trust_dns_client::rr::dnssec::tsig::TSigner; pub mod dhcid; pub mod update; -use dhcid::DhcId; - +use crate::dhcid::DhcId; use crate::update::Updater; #[derive(Debug, Default)] @@ -59,6 +61,7 @@ impl DdnsUpdate { cfg: Option<&Ddns>, server_opts: &NetRange, leased: Ipv4Addr, + lease_length: Duration, ) -> Result<(), DdnsError> { let Some(cfg) = cfg else { debug!("no DDNS config is present. No update performed"); @@ -73,16 +76,17 @@ impl DdnsUpdate { } return Ok(()); }; + let lease_length = lease_length.as_secs() as u32; match self.get_fqdn(ctx, cfg, server_opts) { Ok(Action::UpdateFQDN((resp_fqdn, forward, reverse, cfg))) => { let domain = resp_fqdn.domain().clone(); ctx.resp_msg_mut() .map(|msg| msg.opts_mut().insert(DhcpOption::ClientFQDN(resp_fqdn))); - self.send_dns(ctx, cfg, duid, leased, domain, forward, reverse) + self.send_dns(cfg, duid, leased, lease_length, domain, forward, reverse) .await?; } Ok(Action::UpdateHostname((domain, forward, reverse, cfg))) => { - self.send_dns(ctx, cfg, duid, leased, domain, forward, reverse) + self.send_dns(cfg, duid, leased, lease_length, domain, forward, reverse) .await?; } Ok(Action::DontUpdateFQDN(mut resp_fqdn)) => { @@ -164,45 +168,40 @@ impl DdnsUpdate { } } + #[tracing::instrument(skip_all, fields(domain = %domain, duid = ?duid, leased_ip = %leased))] async fn send_dns( &self, - ctx: &mut MsgContext, cfg: &Ddns, duid: DhcId, leased: Ipv4Addr, + lease_length: u32, domain: Name, forward: bool, reverse: bool, ) -> Result<(), DdnsError> { - let Some(DhcpOption::AddressLeaseTime(lease_length)) = - ctx.msg().opts().get(OptionCode::AddressLeaseTime) - else { - error!("address lease time not available for DDNS update"); - return Err(DdnsError::SendFailed); - }; - if forward { - if let Some(srv) = cfg.match_longest_forward(&domain) { - let tsig = if let Some(key_name) = &srv.key { - Some(tsigner(key_name, cfg)?) - } else { - None - }; - let zone = srv.name.clone(); - // todo: likely re-creating the same client for each update - // should cache this in parent type - let mut client = Updater::new(srv.ip, tsig).await?; + if forward && let Some(srv) = cfg.match_longest_forward(&domain) { + let tsig = if let Some(key_name) = &srv.key { + trace!(?key_name, "using signing key"); + Some(tsigner(key_name, cfg)?) + } else { + warn!("no signing key found for domain"); + None + }; + let zone = srv.name.clone(); + // todo: likely re-creating the same client for each update + // should cache this in parent type + let mut client = Updater::new(srv.ip, tsig).await?; - // todo: zone origin same as domain? - match client - .forward(zone, domain.clone(), duid.clone(), leased, *lease_length) - .await - { - Ok(_) => { - info!(?domain, "successfully updated DNS"); - } - Err(err) => { - error!(?err, ?domain, "failed to update DNS"); - } + // todo: zone origin same as domain? + match client + .forward(zone, domain.clone(), duid.clone(), leased, lease_length) + .await + { + Ok(_) => { + debug!("updated DNS"); + } + Err(err) => { + error!(?err, "failed to update DNS"); } } } @@ -220,7 +219,7 @@ impl DdnsUpdate { let mut client = Updater::new(srv.ip, tsig).await?; match client - .reverse(zone, domain.clone(), duid.clone(), leased, *lease_length) + .reverse(zone, domain.clone(), duid.clone(), leased, lease_length) .await { Ok(_) => { @@ -241,8 +240,10 @@ impl DdnsUpdate { pub enum TsigError { #[error("key not found {key_name:?}")] KeyNotFound { key_name: String }, + #[error("key not base64 {0:?}")] + KeyNotBase64(#[from] base64::DecodeError), #[error("failed to create TSigner {0:?}")] - TSignerFailed(#[from] NameError), + TSignerFailed(#[from] DnsSecError), } pub fn tsigner(key_name: &str, config: &Ddns) -> Result { @@ -252,14 +253,20 @@ pub fn tsigner(key_name: &str, config: &Ddns) -> Result { key_name: key_name.to_owned(), }); }; + let key_bin = BASE64_STANDARD + .decode(key.data.as_bytes()) + .map_err(TsigError::KeyNotBase64)?; + // create new tsigner - Ok(TSigner::new( - key.data.as_bytes().to_owned(), + let signer = TSigner::new( + key_bin, key.algorithm.clone(), Name::from_ascii(key_name).unwrap(), // TODO: remove unwrap // ?? 300, - )?) + ) + .map_err(TsigError::TSignerFailed)?; + Ok(signer) } fn handle_flags( diff --git a/libs/ddns/src/update.rs b/libs/ddns/src/update.rs index a125376..b2d5b3c 100644 --- a/libs/ddns/src/update.rs +++ b/libs/ddns/src/update.rs @@ -7,35 +7,41 @@ use std::{ use dora_core::{ dhcproto::{Name, NameError}, - tokio, - tokio::{net::UdpSocket, task::JoinHandle}, - tracing::{debug, error, info}, - trust_dns_proto::{DnsHandle, xfer::FirstAnswer}, -}; -use trust_dns_client::{ - client::AsyncClient, op::ResponseCode, rr::dnssec::tsig::TSigner, udp::UdpClientStream, + hickory_proto::{ + self, + dnssec::tsig::TSigner, + op::ResponseCode, + rr::{ + DNSClass, RecordData, + RecordType::{self, Unknown}, + rdata::{A, PTR}, + }, + runtime::TokioRuntimeProvider, + udp::UdpClientStream, + xfer::{DnsRequest, DnsRequestOptions, DnsRequestSender, FirstAnswer}, + }, + tracing::{debug, error, info, trace}, }; use crate::dhcid::DhcId; pub struct Updater { - client: AsyncClient, - handle: JoinHandle>, + client: UdpClientStream, } impl Updater { pub async fn new(dst: SocketAddr, tsig: Option) -> Result { // todo: create stream per forward/reverse server - let stream = UdpClientStream::::with_timeout_and_signer_and_bind_addr( - dst, - Duration::from_secs(5), - tsig.map(Arc::new), - None, - ); - let (client, bg) = AsyncClient::connect(stream).await?; - let handle = tokio::spawn(bg); - - Ok(Self { client, handle }) + let mut stream_builder = UdpClientStream::builder(dst, TokioRuntimeProvider::default()) + .with_timeout(Some(Duration::from_secs(5))); + if let Some(tsig) = tsig { + trace!(signer_name = ?tsig.signer_name(), "added signer to ddns update"); + stream_builder = stream_builder.with_signer(Some(Arc::new(tsig))); + } + + let client = stream_builder.build().await?; + + Ok(Self { client }) } pub async fn forward( &mut self, @@ -55,18 +61,20 @@ impl Updater { ttl, false, )?; - let resp = self.client.send(message).first_answer().await?; + let request = DnsRequest::new(message, DnsRequestOptions::default()); + let resp = self.client.send_message(request).first_answer().await?; if resp.response_code() == ResponseCode::NoError { Ok(()) } else if resp.response_code() == ResponseCode::YXDomain { debug!(?resp, "got back YXDOMAIN, sending update with dhcid prereq"); let new_msg = update_present(zone.clone(), domain.clone(), duid, leased, ttl, false)?; - let yx_resp = self.client.send(new_msg).first_answer().await?; + let yx_request = DnsRequest::new(new_msg, DnsRequestOptions::default()); + let yx_resp = self.client.send_message(yx_request).first_answer().await?; if yx_resp.response_code() == ResponseCode::NoError { - info!(?domain, "got NOERROR, updated DNS"); + info!("got NOERROR, updated DNS"); Ok(()) } else { - error!(?domain, "failed to updated dns"); + error!("failed to update dns"); Err(UpdateError::ResponseCode(yx_resp.response_code())) } } else { @@ -84,7 +92,8 @@ impl Updater { let ttl = calculate_ttl(lease_length); let message = delete(zone, domain.clone(), duid.clone(), leased, ttl, false)?; - let resp = self.client.send(message).first_answer().await?; + let request = DnsRequest::new(message, DnsRequestOptions::default()); + let resp = self.client.send_message(request).first_answer().await?; if resp.response_code() == ResponseCode::NoError { Ok(()) } else { @@ -95,7 +104,7 @@ impl Updater { impl Drop for Updater { fn drop(&mut self) { - self.handle.abort(); + self.client.shutdown(); } } @@ -106,30 +115,32 @@ pub fn update( leased: Ipv4Addr, ttl: u32, use_edns: bool, -) -> Result { - use trust_dns_client::{ +) -> Result { + use hickory_proto::{ op::UpdateMessage, - rr::{DNSClass, RData, Record, RecordType, rdata::NULL}, + rr::{DNSClass, RData, Record, rdata::NULL}, }; let mut message = update_msg(zone_origin, use_edns); - let mut prerequisite = Record::with(name.clone(), RecordType::ANY, 0); + let mut prerequisite = Record::update0(name.clone(), 0, RecordType::ANY); prerequisite.set_dns_class(DNSClass::NONE); - message.add_pre_requisite(prerequisite); + message.add_update(prerequisite); - let a_record = Record::from_rdata(name.clone(), ttl, RData::A(leased)); + let a_record = Record::from_rdata(name.clone(), ttl, A(leased).into_rdata()); let dhcid_record = Record::from_rdata( name.clone(), ttl, RData::Unknown { - code: 49, + code: Unknown(49), rdata: NULL::with(duid.rdata(&name)?), }, ); message.add_update(a_record); message.add_update(dhcid_record); + trace!(?message, "created ddns update message"); + Ok(message) } @@ -140,32 +151,33 @@ pub fn update_present( leased: Ipv4Addr, ttl: u32, use_edns: bool, -) -> Result { - use trust_dns_client::{ +) -> Result { + use hickory_proto::{ op::UpdateMessage, - rr::{DNSClass, RData, Record, RecordType, rdata::NULL}, + rr::{RData, Record, rdata::NULL}, }; let mut message = update_msg(zone_origin, use_edns); - let mut prerequisite = Record::with(name.clone(), RecordType::ANY, 0); + let mut prerequisite = Record::update0(name.clone(), 0, RecordType::ANY); // use ANY to check only update if this name is present prerequisite.set_dns_class(DNSClass::ANY); - message.add_pre_requisite(prerequisite); + message.add_update(prerequisite); // add dhcid to prereqs, will only update if dhcid is present let dhcid_record = Record::from_rdata( name.clone(), 0, RData::Unknown { - code: 49, + code: Unknown(49), rdata: NULL::with(duid.rdata(&name)?), }, ); - message.add_pre_requisite(dhcid_record); + message.add_update(dhcid_record); - let a_record = Record::from_rdata(name, ttl, RData::A(leased)); + let a_record: Record = Record::from_rdata(name, ttl, A(leased).into_rdata()); message.add_update(a_record); + trace!(?message, "created update message with dhcid"); Ok(message) } @@ -176,8 +188,8 @@ pub fn delete( leased: Ipv4Addr, ttl: u32, use_edns: bool, -) -> Result { - use trust_dns_client::{ +) -> Result { + use hickory_proto::{ op::UpdateMessage, rr::{RData, Record, RecordType, rdata::NULL}, }; @@ -186,28 +198,29 @@ pub fn delete( let mut message = update_msg(zone_origin, use_edns); // delete - let owner = Record::with(rev_ip.clone(), RecordType::ANY, 0); - let dhcid = Record::with(rev_ip.clone(), RecordType::ANY, 0); + let owner = Record::update0(rev_ip.clone(), 0, RecordType::ANY); + let dhcid = Record::update0(rev_ip.clone(), 0, RecordType::ANY); message.add_update(owner); message.add_update(dhcid); // add - let ptr_record = Record::from_rdata(rev_ip.clone(), ttl, RData::PTR(name.clone())); + let ptr_record = Record::from_rdata(rev_ip.clone(), ttl, PTR(name.clone()).into_rdata()); let dhcid_record = Record::from_rdata( rev_ip, ttl, RData::Unknown { - code: 49, + code: Unknown(49), rdata: NULL::with(duid.rdata(&name)?), }, ); message.add_update(ptr_record); message.add_update(dhcid_record); + trace!(?message, "created delete message"); Ok(message) } -fn update_msg(zone_origin: Name, use_edns: bool) -> trust_dns_client::op::Message { - use trust_dns_client::{ +fn update_msg(zone_origin: Name, use_edns: bool) -> hickory_proto::op::Message { + use hickory_proto::{ op::{Edns, Message, MessageType, OpCode, Query, UpdateMessage}, rr::{DNSClass, RecordType}, }; diff --git a/libs/discovery/Cargo.toml b/libs/discovery/Cargo.toml index 1edfb2e..2d1d2f3 100644 --- a/libs/discovery/Cargo.toml +++ b/libs/discovery/Cargo.toml @@ -8,4 +8,4 @@ license = "MPL-2.0" [dependencies] anyhow = { workspace = true } -trust-dns-resolver = "0.20.0" +hickory-resolver = "0.25.2" diff --git a/libs/discovery/src/lib.rs b/libs/discovery/src/lib.rs index f517049..aecefd3 100644 --- a/libs/discovery/src/lib.rs +++ b/libs/discovery/src/lib.rs @@ -16,20 +16,24 @@ attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables)) ))] use anyhow::{Context, Result}; -use trust_dns_resolver::{TokioAsyncResolver, lookup::Ipv4Lookup}; +use hickory_resolver::config::ResolverOpts; +use hickory_resolver::name_server::TokioConnectionProvider; +use hickory_resolver::{Resolver, TokioResolver, lookup::Ipv4Lookup}; /// DNS service discovery #[derive(Debug)] pub struct DnsServiceDiscovery { - resolver: TokioAsyncResolver, + resolver: TokioResolver, } impl DnsServiceDiscovery { /// Create a new service pub fn new() -> Result { Ok(Self { - resolver: TokioAsyncResolver::tokio_from_system_conf() - .context("failed to create tokio resolver")?, + resolver: Resolver::builder(TokioConnectionProvider::default()) + .context("failed to create tokio resolver")? + .with_options(ResolverOpts::default()) + .build(), }) } diff --git a/libs/icmp-ping/src/errors.rs b/libs/icmp-ping/src/errors.rs index f486215..96b4663 100644 --- a/libs/icmp-ping/src/errors.rs +++ b/libs/icmp-ping/src/errors.rs @@ -1,3 +1,4 @@ +#![allow(unused_assignments)] use crate::Token; #[derive(thiserror::Error, Debug)] diff --git a/plugins/leases/src/lib.rs b/plugins/leases/src/lib.rs index f841f65..7c2e2b7 100644 --- a/plugins/leases/src/lib.rs +++ b/plugins/leases/src/lib.rs @@ -365,7 +365,7 @@ where let dhcid = dhcid(self.cfg.v4(), ctx.msg()); if let Err(err) = self .ddns - .update(ctx, dhcid, self.cfg.v4().ddns(), range, ip) + .update(ctx, dhcid, self.cfg.v4().ddns(), range, ip, lease.0) .await { error!(?err, "error during ddns update"); diff --git a/plugins/message-type/src/lib.rs b/plugins/message-type/src/lib.rs index 6a04ca4..f4e53fb 100644 --- a/plugins/message-type/src/lib.rs +++ b/plugins/message-type/src/lib.rs @@ -231,10 +231,10 @@ impl RespServerId { if let Some(&DhcpOption::ServerIdentifier(msg_id)) = msg_server_id_opt { // if the server override matches the msg server id, we should respond - if let Some(override_id) = server_id_override { - if override_id == msg_id { - return Self::ServerIdOverride(override_id); - } + if let Some(override_id) = server_id_override + && override_id == msg_id + { + return Self::ServerIdOverride(override_id); } // we should not respond if the server id from the config does not match the msg server id and // the msg server id is not unspecified diff --git a/rust-toolchain.toml b/rust-toolchain.toml index c1bc0a6..d72668b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.85.0" +channel = "1.91.0"