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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0909201725070.25015@ask.diku.dk>
Date:	Sun, 20 Sep 2009 17:26:57 +0200 (CEST)
From:	Jesper Dangaard Brouer <hawk@...u.dk>
To:	Stephen Hemminger <shemminger@...tta.com>
Cc:	David Miller <davem@...emloft.net>,
	Robert Olsson <robert@...julf.net>,
	Jesper Dangaard Brouer <jdb@...x.dk>,
	netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH 1/2] pktgen: check for link down


Thanks for fixing this.

Acked-by: Jesper Dangaard Brouer <hawk@...x.dk>


On Sat, 19 Sep 2009, Stephen Hemminger wrote:

> 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);

Hilsen
   Jesper Brouer

--
-------------------------------------------------------------------
MSc. Master of Computer Science
Dept. of Computer Science, University of Copenhagen
Author of http://www.adsl-optimizer.dk
-------------------------------------------------------------------
--
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