-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwarden-ignore-ifb-errors.diff
52 lines (44 loc) · 2.45 KB
/
warden-ignore-ifb-errors.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
diff --git a/warden/root/linux/skeleton/lib/hook-parent-after-clone.sh b/warden/root/linux/skeleton/lib/hook-parent-after-clone.sh
index d47fa89..b2b7f66 100755
--- a/warden/root/linux/skeleton/lib/hook-parent-after-clone.sh
+++ b/warden/root/linux/skeleton/lib/hook-parent-after-clone.sh
@@ -62,10 +62,10 @@ ip link set $network_container_iface netns $PID
ifconfig $network_host_iface $network_host_ip netmask $network_netmask mtu $container_iface_mtu
# setup ifb device for traffic shaping
-ip link add ${network_ifb_iface} type ifb
-ip link set ${network_ifb_iface} netns 1
-ifconfig ${network_ifb_iface} mtu ${container_iface_mtu}
+ip link add ${network_ifb_iface} type ifb || true
+ip link set ${network_ifb_iface} netns 1 || true
+ifconfig ${network_ifb_iface} mtu ${container_iface_mtu} || true
-ip link set ${network_ifb_iface} up
+ip link set ${network_ifb_iface} up || true
exit 0
diff --git a/warden/root/linux/skeleton/net.sh b/warden/root/linux/skeleton/net.sh
index 5f1a55f..5886974 100755
--- a/warden/root/linux/skeleton/net.sh
+++ b/warden/root/linux/skeleton/net.sh
@@ -155,11 +155,11 @@ case "${1}" in
;;
"get_ingress_info")
- tc qdisc show dev ${network_ifb_iface}
+ tc qdisc show dev ${network_ifb_iface} || true
;;
"get_egress_info")
- tc qdisc show dev ${network_host_iface}
+ tc qdisc show dev ${network_host_iface} || true
;;
*)
diff --git a/warden/root/linux/skeleton/net_rate.sh b/warden/root/linux/skeleton/net_rate.sh
index c3914c7..4e5a445 100755
--- a/warden/root/linux/skeleton/net_rate.sh
+++ b/warden/root/linux/skeleton/net_rate.sh
@@ -36,8 +36,8 @@ tc qdisc del dev ${network_ifb_iface} root 2> /dev/null || true
tc qdisc add dev ${network_host_iface} root tbf rate ${RATE}bit burst ${BURST} latency 25ms
# limit outbound from container (w-<cid>-1 -> w-<cid>-0 -> w-<cid>-2 -> eth0 -> outside)
-tc qdisc add dev ${network_ifb_iface} root tbf rate ${RATE}bit burst ${BURST} latency 25ms
+tc qdisc add dev ${network_ifb_iface} root tbf rate ${RATE}bit burst ${BURST} latency 25ms || true
# mirror outbound from container (host adapter ingress) to ifb
tc qdisc add dev ${network_host_iface} ingress handle ffff:
-tc filter add dev ${network_host_iface} parent ffff: protocol all u32 match ip src 0.0.0.0/0 action mirred egress redirect dev ${network_ifb_iface}
+tc filter add dev ${network_host_iface} parent ffff: protocol all u32 match ip src 0.0.0.0/0 action mirred egress redirect dev ${network_ifb_iface} || true