patch-2.1.88 linux/net/802/tr.c

Next file: linux/net/Config.in
Previous file: linux/net/802/psnap.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.87/linux/net/802/tr.c linux/net/802/tr.c
@@ -50,7 +50,7 @@
 	unsigned char addr[TR_ALEN];
 	unsigned char iface[5];
 	__u16 rcf;
-	__u8 rseg[8];
+	__u16 rseg[8];
 	rif_cache next;
 	unsigned long last_used;
 	unsigned char local_ring;
@@ -441,7 +441,7 @@
 	int len=0;
 	off_t begin=0;
 	off_t pos=0;
-	int size,i,j,rcf_len;
+	int size,i,j,rcf_len,segment,brdgnmb;
 	unsigned long now=jiffies;
 
 	rif_cache entry;
@@ -466,10 +466,18 @@
 				rcf_len = ((ntohs(entry->rcf) & TR_RCF_LEN_MASK)>>8)-2; 
 				if (rcf_len)
 				        rcf_len >>= 1;
-				for(j = 0; j < rcf_len; j++) {
-				        len+=size;
-				        pos=begin+len;
-			                size=sprintf(buffer+len," %04X",ntohs(entry->rseg[j]));
+				for(j = 1; j < rcf_len; j++) {
+					if(j==1) {
+						segment=ntohs(entry->rseg[j-1])>>4;
+						len+=size;
+						pos=begin+len;
+						size=sprintf(buffer+len,"  %03X",segment);
+					};
+					segment=ntohs(entry->rseg[j])>>4;
+					brdgnmb=ntohs(entry->rseg[j-1])&0x00f;
+					len+=size;
+					pos=begin+len;
+					size=sprintf(buffer+len,"-%01X-%03X",brdgnmb,segment);
 				}
 				len+=size;
 				pos=begin+len;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov