mirror of
https://github.com/jmcorgan/fips.git
synced 2026-08-09 00:04:54 +00:00
Update dependencies: rand 0.10, rtnetlink 0.20, tun 0.8, and others
Bump rand (0.8→0.10), rtnetlink (0.14→0.20), tun (0.7→0.8), simple-dns (0.9→0.11), socket2 (0.5→0.6), and criterion (0.5→0.8). Migrate all rand call sites: thread_rng()→rng(), gen()→random(), gen_range()→random_range(), RngCore→Rng trait. Work around secp256k1 0.30 requiring rand 0.8 by generating random bytes directly and constructing SecretKey from slice. Migrate rtnetlink to builder-based API: LinkSetRequest replaced with LinkUnspec builder + change(), RouteAddRequest replaced with RouteMessageBuilder. Remove bloom benchmark (criterion 0.8 incompatible with old harness config).
This commit is contained in:
+12
-8
@@ -6,7 +6,7 @@
|
||||
|
||||
use crate::{FipsAddress, TunConfig};
|
||||
use futures::TryStreamExt;
|
||||
use rtnetlink::{new_connection, Handle};
|
||||
use rtnetlink::{new_connection, Handle, LinkUnspec, RouteMessageBuilder};
|
||||
use std::fs::File;
|
||||
use std::io::{Read, Write};
|
||||
use std::net::Ipv6Addr;
|
||||
@@ -443,22 +443,26 @@ async fn configure_interface(name: &str, addr: Ipv6Addr, mtu: u16) -> Result<(),
|
||||
// Set MTU
|
||||
handle
|
||||
.link()
|
||||
.set(index)
|
||||
.mtu(mtu as u32)
|
||||
.change(LinkUnspec::new_with_index(index).mtu(mtu as u32).build())
|
||||
.execute()
|
||||
.await?;
|
||||
|
||||
// Bring interface up
|
||||
handle.link().set(index).up().execute().await?;
|
||||
handle
|
||||
.link()
|
||||
.change(LinkUnspec::new_with_index(index).up().build())
|
||||
.execute()
|
||||
.await?;
|
||||
|
||||
// Add route for fd00::/8 (FIPS address space) via this interface
|
||||
let fd_prefix: Ipv6Addr = "fd00::".parse().unwrap();
|
||||
handle
|
||||
.route()
|
||||
.add()
|
||||
.v6()
|
||||
let route = RouteMessageBuilder::<Ipv6Addr>::new()
|
||||
.destination_prefix(fd_prefix, 8)
|
||||
.output_interface(index)
|
||||
.build();
|
||||
handle
|
||||
.route()
|
||||
.add(route)
|
||||
.execute()
|
||||
.await
|
||||
.map_err(|e| TunError::Configure(format!("failed to add fd00::/8 route: {}", e)))?;
|
||||
|
||||
Reference in New Issue
Block a user