[parisc-linux] [PATCH] Prevent loopback traffic to be shown on the network leds

Rüdiger Scholz rscholz@hrzpub.tu-darmstadt.de
Sat, 19 Jul 2003 13:31:41 +0200


This is a multi-part message in MIME format.
--------------080307050105090100090206
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

looking at the Download page from the ESIEE-Team I found the following 
patch from Thibaut. It filters the traffic from/to the loopback device, 
so network led isn't blinking when accessing the loopback device. 
Should'nt it go into CVS?

Rüdiger

--------------080307050105090100090206
Content-Type: text/plain;
 name="led.c-diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="led.c-diff"

Index: linux/arch/parisc/kernel/led.c
===================================================================
RCS file: /var/cvs/linux/arch/parisc/kernel/led.c,v
retrieving revision 1.28
diff -u -p -u -r1.28 led.c
--- linux/arch/parisc/kernel/led.c	29 Sep 2002 15:49:20 -0000	1.28
+++ linux/arch/parisc/kernel/led.c	17 Jan 2003 16:02:56 -0000
@@ -365,10 +365,12 @@ static void led_get_net_stats(int addval
 	 * for reading should be OK */
 	read_lock(&dev_base_lock);
 	for (dev = dev_base; dev != NULL; dev = dev->next) {
-	    if (dev->get_stats) { 
-	        stats = dev->get_stats(dev);
-		rx_total += stats->rx_packets;
-		tx_total += stats->tx_packets;
+	    if (!(dev->flags & IFF_LOOPBACK)) {
+		if (dev->get_stats) {
+		    stats = dev->get_stats(dev);
+		    rx_total += stats->rx_packets;
+		    tx_total += stats->tx_packets;
+		}
 	    }
 	}
 	read_unlock(&dev_base_lock);

--------------080307050105090100090206--