From 0253b5fdc33a7ab01d05e59b42b458f4145d7917 Mon Sep 17 00:00:00 2001 From: mt
Date: Fri, 5 Feb 2010 11:51:32 +0000 Subject: [PATCH] Added route proto filter to ifstatus-route to evaluate only routes
Hello community, here is the log from the commit of package sysconfig for openSUSE:Factory checked in at Thu Feb 18 17:14:58 CET 2010. -------- --- sysconfig/sysconfig.changes 2010-01-14 16:04:00.000000000 +0100 +++ sysconfig/sysconfig.changes 2010-02-17 18:37:16.000000000 +0100 @@ -1,0 +2,20 @@ +Wed Feb 17 18:31:54 CET 2010 - kay.sievers@novell.com + +- do not require hal, NetworkManager dropped it + +------------------------------------------------------------------- +Fri Feb 12 12:36:05 CET 2010 - mt@suse.de + +- Added route proto filter to ifstatus-route to evaluate only + routes that may have been set by ifup-route and skip routes + added e.g. by zebra to not to waste CPU for big zebra routing + tables (bnc#572205). Thanks to Adrian Ban for initial patch! + +------------------------------------------------------------------- +Thu Jan 21 15:59:38 UTC 2010 - mt@suse.de + +- Fixed ifup-802.1q script to correctly search for the interface + name of a vlan id in case multiple interfaces are using same + vlan id. Thanks to Adrian Ban for a correction! (bnc#572186) + +------------------------------------------------------------------- calling whatdependson for head-i586 New: ---- sysconfig-ifstatus-route-proto-filter.bnc572205.diff sysconfig-same-vlan-id-on-multiple-ifaces.bnc572186.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sysconfig.spec ++++++ --- /var/tmp/diff_new_pack.U24tVH/_old 2010-02-18 17:11:27.000000000 +0100 +++ /var/tmp/diff_new_pack.U24tVH/_new 2010-02-18 17:11:27.000000000 +0100 @@ -20,15 +20,17 @@ Name: sysconfig Version: 0.73.3 -Release: 1 +Release: 2 Summary: The sysconfig scheme Group: System/Base License: GPLv2+ AutoReqProv: on PreReq: %fillup_prereq %insserv_prereq textutils fileutils gawk sed grep -Requires: iproute2 dbus-1 hal procps +Requires: iproute2 dbus-1 procps BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: %name-%version.tar.bz2 +Patch1: sysconfig-same-vlan-id-on-multiple-ifaces.bnc572186.diff +Patch2: sysconfig-ifstatus-route-proto-filter.bnc572205.diff %description This package provides the SuSE system configuration scheme. @@ -49,6 +51,8 @@ %prep %setup -n sysconfig-%{version} +%patch1 -p1 +%patch2 -p1 %build autoreconf --force --install ++++++ sysconfig-ifstatus-route-proto-filter.bnc572205.diff ++++++ that may have been set by ifup-route and skip routes added e.g. by zebra to not to waste CPU for big zebra routing tables (bnc#572205). git-svn-id: https://svn.suse.de/svn/sysconfig/trunk@2087 bf393798-0adf-0310-9952-bd479070b6c1 --- scripts/ifup-route | 39 +++++++++++++++++++++++++++++++++------ 1 files changed, 33 insertions(+), 6 deletions(-) diff --git a/scripts/ifup-route b/scripts/ifup-route index 03c5b4f..ae8b496 100755 --- a/scripts/ifup-route +++ b/scripts/ifup-route @@ -107,6 +107,33 @@ test -f $ROUTECONF || ROUTECONF="" EXTRAROUTECONF=ifroute-$CONFIG test -f $EXTRAROUTECONF || EXTRAROUTECONF="" +# initialize route protos used in files we should consider +# in the ifstatus check (usually not used, see bnc#572205) +if [ "$ACTION" = status ] ; then + ROUTE_PROTOS=`LANG=C LC_ALL=C awk -- \ + '$1 !~ /^(#.*)?$/ { + if(match($0,"proto ([^ ]+)",p)) { + l=length(l) > 0 ? l"|"p[1] : p[1] + } + } + END { print l;}' \ + $ROUTECONF $EXTRAROUTECONF < /dev/null 2>/dev/null` +else + ROUTE_PROTOS="" +fi + +filter_routes() +{ + LANG=C LC_ALL=C awk -vrp="$ROUTE_PROTOS" -- \ + '/proto [^ ]+/ { + if(length(rp) > 0 && match($0,"proto ("rp")")) { + print $0; + } + next; + } + { print $0;}' +} + # # add special link local route # can configure only one interface this way at the moment @@ -122,7 +149,7 @@ if [ -d /sys/class/net/$INTERFACE ] ; then # Don't add this route if interface has no v4 address (Bug 65557) test -z "`ip -4 a l dev $INTERFACE 2>/dev/null`" && islinklocal= if test -n "$islinklocal" ; then - current=`ip -4 route show 169.254.0.0/16` + current=`ip -4 route show 169.254.0.0/16 | filter_routes` if test -z "$current" -o "$current" != "${current/ dev $INTERFACE }"; then EXTRALINKLOCAL="169.254.0.0/16 - - $INTERFACE" fi @@ -215,7 +242,7 @@ pop_route_stack () { # At first look for the current default route interface via 'ip route' and store # it in $DR_IFACE. - set -- `ip route` + set -- `ip -4 route show | filter_routes` while [ "$1" != default -a $# -gt 0 ] ; do shift; done while [ "$1" != dev -a $# -gt 0 ] ; do shift; done DR_IFACE=$2 @@ -283,7 +310,7 @@ get_default_route() { OLDDEFROUTEIFACE=$IFACE return fi - done < <(ip -4 route show) + done < <(ip -4 route show | filter_routes) return 1 } @@ -318,7 +345,7 @@ if [ "$ACTION" = status ] ; then *) ALL_ROUTES="$ALL_ROUTES ${DEST}_${GWAY}_${IFACE}_" ;; esac - done < <(ip -4 route show) + done < <(ip -4 route show | filter_routes) declare -i n=0 m=0 fi @@ -514,7 +541,7 @@ if [ "$ACTION" = status ] ; then IFACE_ROUTES="" while read LINE; do IFACE_ROUTES="${IFACE_ROUTES:+$IFACE_ROUTES\n} $LINE" - done < <(ip -4 route show dev $INTERFACE 2>/dev/null) + done < <(ip -4 route show dev $INTERFACE 2>/dev/null | filter_routes) test -n "$IFACE_ROUTES" && message_if_not_run_from_rc "Active IPv4 routes for interface $INTERFACE:" message_if_not_run_from_rc "$IFACE_ROUTES" test $n -gt 0 && \ @@ -522,7 +549,7 @@ if [ "$ACTION" = status ] ; then IFACE_ROUTES="" while read LINE; do IFACE_ROUTES="${IFACE_ROUTES:+$IFACE_ROUTES\n} $LINE" - done < <(ip -6 route show dev $INTERFACE 2>/dev/null) + done < <(ip -6 route show dev $INTERFACE 2>/dev/null | filter_routes) test -n "$IFACE_ROUTES" && message_if_not_run_from_rc "Active IPv6 routes for interface $INTERFACE:" message_if_not_run_from_rc "$IFACE_ROUTES" test $n -ne $m && exit 3 -- 1.6.4.2 ++++++ sysconfig-same-vlan-id-on-multiple-ifaces.bnc572186.diff ++++++
From 2b7e9d3d98b593a794180eab79af71e78ff7b39d Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski
Date: Thu, 21 Jan 2010 16:49:42 +0100 Subject: [PATCH] Fixed ifup-802.1q script to correctly search for the interface name for a vlan id in case multiple interfaces are using same vlan id. Thanks to Adrian Ban for providing a patch! (bnc#572186).
--- scripts/ifup-802.1q | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ifup-802.1q b/scripts/ifup-802.1q index d94a84a..9bded41 100644 --- a/scripts/ifup-802.1q +++ b/scripts/ifup-802.1q @@ -109,9 +109,9 @@ map_proc_to_vconfig() } get_vlan_iface_name() { - awk -v vid="$1" -- 'BEGIN{ nt=0; } + awk -v vid="$1" -v dev="$2" -- 'BEGIN{ nt=0; } /^Name-Type:/ { nt=1; next; } - nt && $3 == vid { print $1; }' \ + nt && $3 == vid && $5 == dev { print $1; }' \ /proc/net/vlan/config 2>/dev/null } del_pad() @@ -192,7 +192,7 @@ start) # Don't hurry too much udevadm settle - viface=`get_vlan_iface_name "$nr"` + viface=`get_vlan_iface_name "$nr" "$ETHERDEVICE"` if test "x$viface" = x ; then err_mesg "ERROR: unable to find create vlan $id interface '$INTERFACE'" exit $R_ERROR -- 1.6.4.2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org