From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 AF2A8138B0E for ; Mon, 24 Oct 2016 00:23:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1E84DE080A; Mon, 24 Oct 2016 00:23:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0780BE080A for ; Mon, 24 Oct 2016 00:23:22 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B364C34165D for ; Mon, 24 Oct 2016 00:23:21 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8BF9E24A2 for ; Mon, 24 Oct 2016 00:23:19 +0000 (UTC) From: "Robin H. Johnson" 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" Message-ID: <1477268586.95105e7437c1680d564279f4dd7063d7241370ac.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: 95105e7437c1680d564279f4dd7063d7241370ac X-VCS-Branch: master Date: Mon, 24 Oct 2016 00:23:19 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 23b31d8c-8b16-4c4b-8ccd-204b4d0b6ef1 X-Archives-Hash: 4896fd3a48a3a0c518651b924902f98a commit: 95105e7437c1680d564279f4dd7063d7241370ac Author: Robin H. Johnson gentoo org> AuthorDate: Mon Oct 24 00:23:06 2016 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Mon Oct 24 00:23:06 2016 +0000 URL: https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=95105e74 iproute2/_get_route: do not include metric in test for existing route. Signed-off-by: Robin H. Johnson gentoo.org> net/iproute2.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/iproute2.sh b/net/iproute2.sh index 938a5fb..1dff3fe 100644 --- a/net/iproute2.sh +++ b/net/iproute2.sh @@ -232,13 +232,13 @@ _add_route() set -- "${one}" "${two}" via "$@" fi - local cmd= have_metric=false + local cmd= cmd_nometric= have_metric=false while [ -n "$1" ]; do case "$1" in - metric) cmd="${cmd} metric $2"; shift ; have_metric=true;; - netmask) cmd="${cmd}/$(_netmask2cidr "$2")"; shift;; + metric) metric=$2 ; cmd="${cmd} metric $2" ; shift ; have_metric=true ;; + netmask) x="/$(_netmask2cidr "$2")" ; cmd="${cmd}${x}" ; cmd_nometric="${cmd}${x}" ; shift;; -host|-net);; - *) cmd="${cmd} $1";; + *) cmd="${cmd} ${1}" ; cmd_nometric="${cmd_nometric} ${1}" ;; esac shift done @@ -252,7 +252,7 @@ _add_route() fi # Check for route already existing: - ip ${family} route show ${cmd} dev "${IFACE}" 2>/dev/null | \ + ip ${family} route show ${cmd_nometric} dev "${IFACE}" 2>/dev/null | \ fgrep -sq "${cmd%% *}" route_already_exists=$?