aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2020-05-30 22:42:22 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2020-05-30 22:42:22 -0700
commit626cfdad15f9740208807bc436cb3915056c87b4 (patch)
treeef5baa7906578a51a7a2a5b3348510aef29957c1
parentnet/iwd: ensure program is present (diff)
downloadnetifrc-626cfdad.tar.gz
netifrc-626cfdad.tar.bz2
netifrc-626cfdad.zip
net/iproute2: support containers without /proc/sys/net/ipv4/route/flush
Bug: https://bugs.gentoo.org/648600 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r--net/iproute2.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/net/iproute2.sh b/net/iproute2.sh
index 5f65f1c..ca6c0f8 100644
--- a/net/iproute2.sh
+++ b/net/iproute2.sh
@@ -438,8 +438,18 @@ _iproute2_link_delete() {
eend $?
}
+_iproute2_route_flush_supported() {
+ case $FAMILY in
+ -6) p='/proc/sys/net/ipv6/route/flush' ;;
+ -4|*) p='/proc/sys/net/ipv4/route/flush' ;;
+ esac
+ test -f $p
+}
+
_iproute2_route_flush() {
- _cmd ip $FAMILY route flush table cache dev "${IFACE}"
+ if _iproute2_route_flush_supported; then
+ _cmd ip $FAMILY route flush table cache dev "${IFACE}"
+ fi
}
_iproute2_ipv6_tentative_output() {