/proc/net/vlan/config output patch and question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

when creating a VLAN device, I end up with names like
"vlan8_rename@eth0" when using VLAN_NAME_TYPE_PLUS_VID_NO_PAD.  Other
formats have that "_rename" appended as well. Any idea where that comes
from? I'm running a stock 2.6.20.4 kernel on Debian unstable using
vconfig from vlan-1.9-2.  I checked the vconfig sources but these don't
contain the _rename AFAICS.

Another thing I noticed was the slightly confusing output of
"cat /proc/net/vlan/config".  I append a patch that I think improves
that, though I don't know if there are tools parsing that output.

Best,
  Norbert

diff -ur a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
--- a/net/8021q/vlanproc.c	2007-03-26 19:48:57.000000000 -0700
+++ b/net/8021q/vlanproc.c	2007-03-26 19:48:32.000000000 -0700
@@ -280,21 +280,23 @@
 static int vlan_seq_show(struct seq_file *seq, void *v)
 {
 	if (v == SEQ_START_TOKEN) {
-		const char *nmtype = NULL;
-
-		seq_puts(seq, "VLAN Dev name	 | VLAN ID\n");
+		const char *nmtype;
 
 		if (vlan_name_type < ARRAY_SIZE(vlan_name_type_str))
-		    nmtype =  vlan_name_type_str[vlan_name_type];
+		    nmtype = vlan_name_type_str[vlan_name_type];
+		else
+		    nmtype = "UNKNOWN";
+
+		seq_printf(seq, "Name-Type: %s\n", nmtype);
 
-		seq_printf(seq, "Name-Type: %s\n", 
-			   nmtype ? nmtype :  "UNKNOWN" );
+		seq_printf(seq, "%-15s | %7s | %s\n", "VLAN Dev name",
+			   "VLAN ID", "real Dev name");
 	} else {
 		const struct net_device *vlandev = v;
 		const struct vlan_dev_info *dev_info = VLAN_DEV_INFO(vlandev);
 
-		seq_printf(seq, "%-15s| %d  | %s\n",  vlandev->name,  
-			   dev_info->vlan_id,    dev_info->real_dev->name);
+		seq_printf(seq, "%-15s | %7u | %s\n", vlandev->name,  
+			   dev_info->vlan_id, dev_info->real_dev->name);
 	}
 	return 0;
 }
@@ -319,7 +321,7 @@
 
 	seq_printf(seq, fmt, "total frames received", stats->rx_packets);
 	seq_printf(seq, fmt, "total bytes received", stats->rx_bytes);
-	seq_printf(seq, fmt, "Broadcast/Multicast Rcvd", stats->multicast);
+	seq_printf(seq, fmt, "Broadcast/Multicast received", stats->multicast);
 	seq_puts(seq, "\n");
 	seq_printf(seq, fmt, "total frames transmitted", stats->tx_packets);
 	seq_printf(seq, fmt, "total bytes transmitted", stats->tx_bytes);
@@ -340,7 +342,7 @@
 		       dev_info->ingress_priority_map[6],
 		       dev_info->ingress_priority_map[7]);
 
-	seq_printf(seq, "EGRESSS priority Mappings: ");
+	seq_printf(seq, "EGRESSS priority mappings: ");
 	for (i = 0; i < 16; i++) {
 		const struct vlan_priority_tci_mapping *mp
 			= dev_info->egress_priority_map[i];

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux