diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2020-05-30 22:42:22 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2020-05-30 22:42:22 -0700 |
commit | 626cfdad15f9740208807bc436cb3915056c87b4 (patch) | |
tree | ef5baa7906578a51a7a2a5b3348510aef29957c1 | |
parent | net/iwd: ensure program is present (diff) | |
download | netifrc-626cfdad15f9740208807bc436cb3915056c87b4.tar.gz netifrc-626cfdad15f9740208807bc436cb3915056c87b4.tar.bz2 netifrc-626cfdad15f9740208807bc436cb3915056c87b4.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.sh | 12 |
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() { |