From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 83B6E13877A for ; Thu, 17 Jul 2014 17:56:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9E1F8E0826; Thu, 17 Jul 2014 17:56:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2DAA4E0826 for ; Thu, 17 Jul 2014 17:56:47 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2BBDF3401D6 for ; Thu, 17 Jul 2014 17:56:46 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 4066B193E5 for ; Thu, 17 Jul 2014 17:56:44 +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: <1405538241.10c365a266c390d0d3e1c26fdb991022e0cd7235.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: 10c365a266c390d0d3e1c26fdb991022e0cd7235 X-VCS-Branch: master Date: Thu, 17 Jul 2014 17:56:44 +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: c85775c5-cebc-43db-a493-43e830d0d6d3 X-Archives-Hash: b833aa3de1505c07b39a1ef017837ab4 commit: 10c365a266c390d0d3e1c26fdb991022e0cd7235 Author: Robin H. Johnson gentoo org> AuthorDate: Wed Jul 16 19:13:20 2014 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Wed Jul 16 19:17:21 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/netifrc.git;a=commit;h=10c365a2 iproute2: verbose output All ip commands that change state should have a ve* call before them to enable verbose output of what is going on. Signed-off-by: Robin H. Johnson gentoo.org> --- net/iproute2.sh | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/net/iproute2.sh b/net/iproute2.sh index 096e724..7f0eccb 100644 --- a/net/iproute2.sh +++ b/net/iproute2.sh @@ -10,11 +10,13 @@ iproute2_depend() _up() { + veinfo ip link set dev "${IFACE}" up ip link set dev "${IFACE}" up } _down() { + veinfo ip link set dev "${IFACE}" down ip link set dev "${IFACE}" down } @@ -57,6 +59,7 @@ _set_flag() flag=${flag#-} opt="off" fi + veinfo ip link set dev "${IFACE}" "${flag}" "${opt}" ip link set dev "${IFACE}" "${flag}" "${opt}" } @@ -79,6 +82,7 @@ _get_mac_address() _set_mac_address() { + veinfo ip link set dev "${IFACE}" address "$1" ip link set dev "${IFACE}" address "$1" } @@ -98,6 +102,7 @@ _get_inet_address() _add_address() { if [ "$1" = "127.0.0.1/8" -a "${IFACE}" = "lo" ]; then + veinfo ip addr add "$@" dev "${IFACE}" 2>/dev/null ip addr add "$@" dev "${IFACE}" 2>/dev/null return 0 fi @@ -202,9 +207,12 @@ _add_route() _delete_addresses() { + veinfo ip addr flush dev "${IFACE}" scope global 2>/dev/null ip addr flush dev "${IFACE}" scope global 2>/dev/null + veinfo ip addr flush dev "${IFACE}" scope site 2>/dev/null ip addr flush dev "${IFACE}" scope site 2>/dev/null if [ "${IFACE}" != "lo" ]; then + veinfo ip addr flush dev "${IFACE}" scope host 2>/dev/null ip addr flush dev "${IFACE}" scope host 2>/dev/null fi return 0 @@ -217,6 +225,7 @@ _has_carrier() _tunnel() { + veinfo ip tunnel "$@" ip tunnel "$@" } @@ -266,6 +275,7 @@ _iproute2_policy_routing() _ip_rule_runner -4 add "${rules}" fi fi + veinfo ip -4 route flush table cache dev "${IFACE}" ip -4 route flush table cache dev "${IFACE}" fi @@ -281,6 +291,7 @@ _iproute2_policy_routing() _ip_rule_runner -6 add "${rules}" fi fi + veinfo ip -6 route flush table cache dev "${IFACE}" ip -6 route flush table cache dev "${IFACE}" fi } @@ -299,6 +310,7 @@ iproute2_pre_start() [ "${tunnel##mode ip6ip6}" != "${tunnel}" ] && ipproto='-6' ebegin "Creating tunnel ${IFVAR}" + veinfo ip ${ipproto} tunnel add ${tunnel} name "${IFACE}" ip ${ipproto} tunnel add ${tunnel} name "${IFACE}" eend $? || return 1 _up @@ -307,12 +319,18 @@ iproute2_pre_start() # MTU support local mtu= eval mtu=\$mtu_${IFVAR} - [ -n "${mtu}" ] && ip link set dev "${IFACE}" mtu "${mtu}" + if [ -n "${mtu}" ]; then + veinfo ip link set dev "${IFACE}" mtu "${mtu}" + ip link set dev "${IFACE}" mtu "${mtu}" + fi # TX Queue Length support local len= eval len=\$txqueuelen_${IFVAR} - [ -n "${len}" ] && ip link set dev "${IFACE}" txqueuelen "${len}" + if [ -n "${len}" ]; then + veinfo ip link set dev "${IFACE}" txqueuelen "${len}" + ip link set dev "${IFACE}" txqueuelen "${len}" + fi local policyroute_order= eval policyroute_order=\$policy_rules_before_routes_${IFVAR} @@ -365,6 +383,7 @@ iproute2_post_stop() # Only do something if the interface actually exist if _exists; then + veinfo ip -4 route flush table cache dev "${IFACE}" ip -4 route flush table cache dev "${IFACE}" fi fi @@ -379,6 +398,7 @@ iproute2_post_stop() # Only do something if the interface actually exist if _exists; then + veinfo ip -6 route flush table cache dev "${IFACE}" ip -6 route flush table cache dev "${IFACE}" fi fi @@ -387,6 +407,7 @@ iproute2_post_stop() if [ "${IFACE}" != "sit0" ]; then if [ -n "$(ip tunnel show "${IFACE}" 2>/dev/null)" ]; then ebegin "Destroying tunnel ${IFACE}" + veinfo ip tunnel del "${IFACE}" ip tunnel del "${IFACE}" eend $? fi