Skip to content

Commit

Permalink
undo modprobes
Browse files Browse the repository at this point in the history
  • Loading branch information
t4lz committed Jan 8, 2025
1 parent d8d18c4 commit 094df00
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 46 deletions.
1 change: 0 additions & 1 deletion mirrord/agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,5 @@ RUN cp /app/target/$(cat /.platform)/release/mirrord-agent /mirrord-agent

FROM ghcr.io/metalbear-co/ci-agent-runtime:latest
COPY --from=builder /mirrord-agent /
RUN apt install -y kmod

CMD ["./mirrord-agent"]
9 changes: 0 additions & 9 deletions mirrord/agent/src/steal/ip_tables.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::{
fmt::Debug,
process::Command,
sync::{Arc, LazyLock},
};

Expand Down Expand Up @@ -119,14 +118,6 @@ pub fn new_ip6tables() -> iptables::IPTables {
{
iptables::new_with_cmd("/usr/sbin/ip6tables-nft")
} else {
let output = Command::new("/usr/sbin/ip6tables-legacy")
.arg("--version")
.output()
.unwrap()
.stdout;
let version = String::from_utf8_lossy(&output);
tracing::info!("Using ip6tables-legacy, version: {version}");

iptables::new_with_cmd("/usr/sbin/ip6tables-legacy")
}
.expect("IPTables initialization may not fail!")
Expand Down
36 changes: 0 additions & 36 deletions mirrord/agent/src/steal/subscriptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,42 +79,6 @@ impl PortRedirector for IptablesListener {
} else {
let safe = crate::steal::ip_tables::SafeIpTables::create(
if self.ipv6 {
std::process::Command::new("modprobe")
.arg("ip6table_nat")
.output()
.map_err(|e| {
tracing::warn!(%e, "manual modprobe ip6_tables failed");
AgentError::IPTablesError(format!(
"manual modprobe ip6table_nat failed: {e:?}"
))
})?;
std::process::Command::new("modprobe")
.arg("ip6_tables")
.output()
.map_err(|e| {
tracing::warn!(%e, "manual modprobe ip6_tables failed");
AgentError::IPTablesError(format!(
"manual modprobe ip6_tables failed: {e:?}"
))
})?;
std::process::Command::new("modprobe")
.arg("nf_nat_ipv6")
.output()
.map_err(|e| {
tracing::warn!(%e, "manual modprobe ip6_tables failed");
AgentError::IPTablesError(format!(
"manual modprobe nf_nat_ipv6 failed: {e:?}"
))
})?;
std::process::Command::new("modprobe")
.arg("nf_conntrack_ipv6")
.output()
.map_err(|e| {
tracing::warn!(%e, "manual modprobe ip6_tables failed");
AgentError::IPTablesError(format!(
"manual modprobe nf_conntrack_ipv6 failed: {e:?}"
))
})?;
new_ip6tables()
} else {
new_iptables()
Expand Down

0 comments on commit 094df00

Please sign in to comment.