File sysconfig-same-vlan-id-on-multiple-ifaces.bnc572186.diff of Package sysconfig

From 2b7e9d3d98b593a794180eab79af71e78ff7b39d Mon Sep 17 00:00:00 2001
From: Marius Tomaschewski <mt@suse.de>
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
openSUSE Build Service is sponsored by