1 |
commit: 626cfdad15f9740208807bc436cb3915056c87b4 |
2 |
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 31 05:42:22 2020 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 31 05:42:22 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=626cfdad |
7 |
|
8 |
net/iproute2: support containers without /proc/sys/net/ipv4/route/flush |
9 |
|
10 |
Bug: https://bugs.gentoo.org/648600 |
11 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> |
12 |
|
13 |
net/iproute2.sh | 12 +++++++++++- |
14 |
1 file changed, 11 insertions(+), 1 deletion(-) |
15 |
|
16 |
diff --git a/net/iproute2.sh b/net/iproute2.sh |
17 |
index 5f65f1c..ca6c0f8 100644 |
18 |
--- a/net/iproute2.sh |
19 |
+++ b/net/iproute2.sh |
20 |
@@ -438,8 +438,18 @@ _iproute2_link_delete() { |
21 |
eend $? |
22 |
} |
23 |
|
24 |
+_iproute2_route_flush_supported() { |
25 |
+ case $FAMILY in |
26 |
+ -6) p='/proc/sys/net/ipv6/route/flush' ;; |
27 |
+ -4|*) p='/proc/sys/net/ipv4/route/flush' ;; |
28 |
+ esac |
29 |
+ test -f $p |
30 |
+} |
31 |
+ |
32 |
_iproute2_route_flush() { |
33 |
- _cmd ip $FAMILY route flush table cache dev "${IFACE}" |
34 |
+ if _iproute2_route_flush_supported; then |
35 |
+ _cmd ip $FAMILY route flush table cache dev "${IFACE}" |
36 |
+ fi |
37 |
} |
38 |
|
39 |
_iproute2_ipv6_tentative_output() { |