mirror of
https://github.com/containers/netavark.git
synced 2026-02-05 06:45:56 +01:00
31
Cargo.lock
generated
31
Cargo.lock
generated
@@ -487,9 +487,9 @@ checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476"
|
||||
|
||||
[[package]]
|
||||
name = "dhcproto"
|
||||
version = "0.9.0"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dcee045385d5f7819022821f41209b9945d17550760b0b2349aaef4ecfa14bc3"
|
||||
checksum = "f6794294f2c4665aae452e950c2803a1e487c5672dc8448f0bfa3f52ff67e270"
|
||||
dependencies = [
|
||||
"dhcproto-macros",
|
||||
"hex",
|
||||
@@ -1221,7 +1221,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "43b627935a2f5d654613bea2bcd677cc760b03ecf224ced0f1970c0d174813b9"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"nix 0.29.0",
|
||||
"nix",
|
||||
"regex",
|
||||
]
|
||||
|
||||
@@ -1371,9 +1371,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "mozim"
|
||||
version = "0.2.5"
|
||||
version = "0.2.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "610e34113d007c3588631f879854c14fbf291f3ab7853b833220f7cbf6ece8ad"
|
||||
checksum = "8232b853f83a0c76331d934627aeec172e9d5f2c82d1f9e7f86caa0df72cb304"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"dhcproto",
|
||||
@@ -1382,7 +1382,7 @@ dependencies = [
|
||||
"libc",
|
||||
"log",
|
||||
"nispor",
|
||||
"nix 0.27.1",
|
||||
"nix",
|
||||
"rand 0.8.5",
|
||||
]
|
||||
|
||||
@@ -1414,7 +1414,7 @@ checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084"
|
||||
|
||||
[[package]]
|
||||
name = "netavark"
|
||||
version = "1.15.1"
|
||||
version = "1.15.2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
@@ -1435,7 +1435,7 @@ dependencies = [
|
||||
"netlink-sys",
|
||||
"nftables",
|
||||
"nispor",
|
||||
"nix 0.29.0",
|
||||
"nix",
|
||||
"once_cell",
|
||||
"prost",
|
||||
"rand 0.9.1",
|
||||
@@ -1562,17 +1562,6 @@ dependencies = [
|
||||
"wl-nl80211",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nix"
|
||||
version = "0.27.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cfg-if",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nix"
|
||||
version = "0.29.0"
|
||||
@@ -1926,7 +1915,7 @@ dependencies = [
|
||||
"netlink-packet-utils",
|
||||
"netlink-proto",
|
||||
"netlink-sys",
|
||||
"nix 0.29.0",
|
||||
"nix",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
]
|
||||
@@ -2927,7 +2916,7 @@ dependencies = [
|
||||
"futures-core",
|
||||
"futures-lite",
|
||||
"hex",
|
||||
"nix 0.29.0",
|
||||
"nix",
|
||||
"ordered-stream",
|
||||
"serde",
|
||||
"serde_repr",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "netavark"
|
||||
version = "1.15.1"
|
||||
version = "1.15.2"
|
||||
edition = "2021"
|
||||
authors = ["github.com/containers"]
|
||||
license = "Apache-2.0"
|
||||
@@ -49,7 +49,7 @@ fs2 = "0.4.3"
|
||||
tokio = { version = "1.45.0", features = ["rt", "rt-multi-thread", "signal", "fs"] }
|
||||
tokio-stream = { version = "0.1.17", features = ["net"] }
|
||||
tonic = "0.13.1"
|
||||
mozim = "0.2.5"
|
||||
mozim = "0.2.6"
|
||||
prost = "0.13.5"
|
||||
futures-channel = "0.3.31"
|
||||
futures-core = "0.3.31"
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
# Release Notes
|
||||
|
||||
## v1.15.2
|
||||
|
||||
* Fixed a bug that caused a thread leak in the dhcp-proxy for each started container. ([#811](https://github.com/containers/netavark/issues/811))
|
||||
* Fixed a bug which printed bogus errors when the dhcp-proxy was run with an activity timeout of 0. ([#1262](https://github.com/containers/netavark/issues/1262))
|
||||
|
||||
## v1.15.1
|
||||
|
||||
* Fixed a regression that caused container name lookups to get the wrong ip address when the host's search domain responded for the same name. ([containers/podman#26198](https://github.com/containers/podman/issues/26198))
|
||||
|
||||
@@ -56,7 +56,7 @@ struct NetavarkProxyService<W: Write + Clear> {
|
||||
// the timeout for the dora operation
|
||||
dora_timeout: u32,
|
||||
// channel send-side for resetting the inactivity timeout
|
||||
timeout_sender: Arc<Mutex<Sender<i32>>>,
|
||||
timeout_sender: Option<Arc<Mutex<Sender<i32>>>>,
|
||||
// All dhcp poll will be spawned on a new task, keep track of it so
|
||||
// we can remove it on teardown. The key is the container mac.
|
||||
task_map: Arc<Mutex<HashMap<String, AbortHandle>>>,
|
||||
@@ -64,17 +64,19 @@ struct NetavarkProxyService<W: Write + Clear> {
|
||||
|
||||
impl<W: Write + Clear> NetavarkProxyService<W> {
|
||||
fn reset_inactivity_timeout(&self) {
|
||||
let sender = self.timeout_sender.clone();
|
||||
let locked_sender = match sender.lock() {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
log::error!("{}", e);
|
||||
return;
|
||||
if let Some(sender) = &self.timeout_sender {
|
||||
let sender_clone = sender.clone();
|
||||
let locked_sender = match sender_clone.lock() {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
log::error!("{}", e);
|
||||
return;
|
||||
}
|
||||
};
|
||||
match locked_sender.try_send(1) {
|
||||
Ok(..) => {}
|
||||
Err(e) => log::error!("{}", e),
|
||||
}
|
||||
};
|
||||
match locked_sender.try_send(1) {
|
||||
Ok(..) => {}
|
||||
Err(e) => log::error!("{}", e),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -285,11 +287,18 @@ pub async fn serve(opts: Opts) -> NetavarkResult<()> {
|
||||
|
||||
// Create send and receive channels for activity timeout. If anything is
|
||||
// sent by the tx side, the inactivity timeout is reset
|
||||
let (activity_timeout_tx, activity_timeout_rx) = mpsc::channel(5);
|
||||
let (activity_timeout_tx, activity_timeout_rx) = if inactivity_timeout.as_secs() > 0 {
|
||||
let (tx, rx) = mpsc::channel(5);
|
||||
(Some(tx), Some(rx))
|
||||
} else {
|
||||
(None, None)
|
||||
};
|
||||
let netavark_proxy_service = NetavarkProxyService {
|
||||
cache: cache.clone(),
|
||||
dora_timeout,
|
||||
timeout_sender: Arc::new(Mutex::new(activity_timeout_tx.clone())),
|
||||
timeout_sender: activity_timeout_tx
|
||||
.clone()
|
||||
.map(|tx| Arc::new(Mutex::new(tx))),
|
||||
task_map: Arc::new(Mutex::new(HashMap::new())),
|
||||
};
|
||||
|
||||
@@ -328,29 +337,31 @@ pub async fn serve(opts: Opts) -> NetavarkResult<()> {
|
||||
///
|
||||
/// ```
|
||||
async fn handle_wakeup<W: Write + Clear>(
|
||||
mut rx: mpsc::Receiver<i32>,
|
||||
rx: Option<mpsc::Receiver<i32>>,
|
||||
timeout_duration: Duration,
|
||||
current_cache: Arc<Mutex<LeaseCache<W>>>,
|
||||
) {
|
||||
loop {
|
||||
match timeout(timeout_duration, rx.recv()).await {
|
||||
Ok(Some(_)) => {
|
||||
debug!("timeout timer reset")
|
||||
}
|
||||
Ok(None) => {
|
||||
println!("timeout channel closed");
|
||||
break;
|
||||
}
|
||||
Err(_) => {
|
||||
// only 'exit' if the timeout is met AND there are no leases
|
||||
// if we do not exit, the activity_timeout is reset
|
||||
if is_catch_empty(current_cache.clone()) {
|
||||
println!(
|
||||
"timeout met: exiting after {} secs of inactivity",
|
||||
timeout_duration.as_secs()
|
||||
);
|
||||
if let Some(mut rx) = rx {
|
||||
loop {
|
||||
match timeout(timeout_duration, rx.recv()).await {
|
||||
Ok(Some(_)) => {
|
||||
debug!("timeout timer reset")
|
||||
}
|
||||
Ok(None) => {
|
||||
println!("timeout channel closed");
|
||||
break;
|
||||
}
|
||||
Err(_) => {
|
||||
// only 'exit' if the timeout is met AND there are no leases
|
||||
// if we do not exit, the activity_timeout is reset
|
||||
if is_catch_empty(current_cache.clone()) {
|
||||
println!(
|
||||
"timeout met: exiting after {} secs of inactivity",
|
||||
timeout_duration.as_secs()
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user