diff options
-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() { |