From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-1175581-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 202AE1382C5 for <garchives@archives.gentoo.org>; Sun, 31 May 2020 05:42:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 214E0E086D; Sun, 31 May 2020 05:42:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 050D6E086D for <gentoo-commits@lists.gentoo.org>; Sun, 31 May 2020 05:42:42 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 60A0534EB55 for <gentoo-commits@lists.gentoo.org>; Sun, 31 May 2020 05:42:41 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C33531F9 for <gentoo-commits@lists.gentoo.org>; Sun, 31 May 2020 05:42:39 +0000 (UTC) From: "Robin H. Johnson" <robbat2@gentoo.org> To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" <robbat2@gentoo.org> Message-ID: <1590903742.626cfdad15f9740208807bc436cb3915056c87b4.robbat2@OpenRC> Subject: [gentoo-commits] proj/netifrc:master commit in: net/ X-VCS-Repository: proj/netifrc X-VCS-Files: net/iproute2.sh X-VCS-Directories: net/ X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: 626cfdad15f9740208807bc436cb3915056c87b4 X-VCS-Branch: master Date: Sun, 31 May 2020 05:42:39 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 377e088c-23c6-4f80-b85b-e7c264562107 X-Archives-Hash: d74b6e753778a1e21bdfb82291420a51 commit: 626cfdad15f9740208807bc436cb3915056c87b4 Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> AuthorDate: Sun May 31 05:42:22 2020 +0000 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> CommitDate: Sun May 31 05:42:22 2020 +0000 URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=626cfdad net/iproute2: support containers without /proc/sys/net/ipv4/route/flush Bug: https://bugs.gentoo.org/648600 Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> net/iproute2.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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() {