From f84d997d4ce910554744f63eb50b2617e4dd59ef Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Wed, 15 Dec 2010 13:02:04 -0800 Subject: Move the ip rule extra output to verbose mode only, and support verbose output on addresses and routes. --- net/iproute2.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'net') diff --git a/net/iproute2.sh b/net/iproute2.sh index 20873464..1cd4f420 100644 --- a/net/iproute2.sh +++ b/net/iproute2.sh @@ -141,6 +141,7 @@ _add_address() ;; esac + veinfo ip addr add "$@" dev "${IFACE}" ip addr add "$@" dev "${IFACE}" } @@ -180,6 +181,7 @@ _add_route() cmd="${cmd} metric ${metric}" fi + veinfo ip ${family} route append ${cmd} dev "${IFACE}" ip ${family} route append ${cmd} dev "${IFACE}" eend $? } @@ -215,19 +217,19 @@ _ip_rule_runner() { local cmd rules OIFS="${IFS}" cmd="$1" rules="$2" - eindent + veindent local IFS="$__IFS" for ru in $rules ; do unset IFS ruN="$(trim "${ru}")" [ -z "${ruN}" ] && continue - ebegin "${cmd} ${ruN}" + vebegin "${cmd} ${ruN}" ip rule ${cmd} ${ru} - eend $? + veend $? local IFS="$__IFS" done IFS="${OIFS}" - eoutdent + veoutdent } iproute2_pre_start() @@ -277,6 +279,7 @@ iproute2_post_start() eerror "IP Policy Routing (CONFIG_IP_MULTIPLE_TABLES) needed for ip rule" else service_set_value "ip_rule" "${rules}" + einfo "Adding RPDB rules" _ip_rule_runner add "${rules}" fi fi @@ -302,7 +305,10 @@ iproute2_post_stop() # Kernel may not have IP built in if [ -e /proc/net/route ]; then local rules="$(service_get_value "ip_rule")" - [ -n "${rules}" ] && _ip_rule_runner del "${rules}" + if [ -n "${rules}" ]; then + einfo "Removing RPDB rules" + _ip_rule_runner del "${rules}" + fi ip route flush table cache dev "${IFACE}" fi -- cgit v1.2.3