Skip to content

Commit

Permalink
fix bug on arp_filter (#55)
Browse files Browse the repository at this point in the history
Signed-off-by: andrewmatilde <[email protected]>
  • Loading branch information
Andrewmatilde committed Jul 28, 2022
1 parent 955c9f1 commit 63c00fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions chaos-tproxy-controller/src/proxy/net/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ impl NetEnv {
let rp_filter_v2 = format!("net.ipv4.conf.{}.rp_filter=0", &self.veth2);
let rp_filter_v3 = format!("net.ipv4.conf.{}.rp_filter=0", &self.veth3);
let arp_filter_br1 = format!("net.ipv4.conf.{}.arp_filter=1", &self.bridge1);
let arp_filter_v1 = format!("net.ipv4.conf.{}.arp_filter=1", &self.veth1);
let arp_filter_dev = format!("net.ipv4.conf.{}.arp_filter=1", &self.device);
let cmdvv = vec![
bash_c(save_dns),
ip_netns_add(&self.netns),
Expand All @@ -99,6 +101,8 @@ impl NetEnv {
ip_link_add_veth_peer(&self.veth4, None, &self.veth3, Some(&self.netns)),
ip_link_set_up(&self.bridge1),
vec!["sysctl", "-w", &arp_filter_br1],
vec!["sysctl", "-w", &arp_filter_v1],
vec!["sysctl", "-w", &arp_filter_dev],
ip_link_set_up(&self.veth1),
ip_netns(&self.netns, ip_link_set_up(&self.veth2)),
ip_netns(&self.netns, ip_link_set_up(&self.bridge2)),
Expand Down

0 comments on commit 63c00fa

Please sign in to comment.