lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090919221844.114e2e23@nehalam>
Date:	Sat, 19 Sep 2009 22:18:44 -0700
From:	Stephen Hemminger <shemminger@...tta.com>
To:	David Miller <davem@...emloft.net>,
	Robert Olsson <robert@...julf.net>,
	Jesper Dangaard Brouer <jdb@...x.dk>
Cc:	netdev@...r.kernel.org
Subject: [PATCH 1/2] pktgen: check for link down

If cable is pulled, pktgen shouldn't continue slamming packets into the
device.

Signed-off-by: Stephen Hemminger <shemminger@...tta.com>

--- a/net/core/pktgen.c	2009-09-19 11:20:55.546463176 -0700
+++ b/net/core/pktgen.c	2009-09-19 11:22:44.810509240 -0700
@@ -1959,7 +1959,7 @@ static int pktgen_setup_dev(struct pktge
 	if (odev->type != ARPHRD_ETHER) {
 		printk(KERN_ERR "pktgen: not an ethernet device: \"%s\"\n", ifname);
 		err = -EINVAL;
-	} else if (!netif_running(odev)) {
+	} else if (!netif_running(odev) || !netif_carrier_ok(odev)) {
 		printk(KERN_ERR "pktgen: device is down: \"%s\"\n", ifname);
 		err = -ENETDOWN;
 	} else {
@@ -3410,7 +3410,7 @@ static void pktgen_xmit(struct pktgen_de
 	/* Did we saturate the queue already? */
 	if (netif_tx_queue_stopped(txq) || netif_tx_queue_frozen(txq)) {
 		/* If device is down, then all queues are permnantly frozen */
-		if (netif_running(odev))
+		if (netif_running(odev) && netif_carrier_ok(odev))
 			idle(pkt_dev);
 		else
 			pktgen_stop_device(pkt_dev);
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ