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: <200812101026.36538.rusty@rustcorp.com.au>
Date:	Wed, 10 Dec 2008 10:26:36 +1030
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	Mark McLoughlin <markmc@...hat.com>
Cc:	netdev <netdev@...r.kernel.org>, kvm <kvm@...r.kernel.org>
Subject: Re: [PATCH] virtio_net: add link status handling

On Tuesday 09 December 2008 20:49:33 Mark McLoughlin wrote:
> Allow the host to inform us that the link is down by adding
> a VIRTIO_NET_F_STATUS which indicates that device status is
> available in virtio_net config.

This has been a TODO for a while, thanks!

> +	if (vi->status == v)
> +		return;
> +
> +	vi->status = v;
> +
> +	if (vi->status & VIRTIO_NET_S_LINK_UP) {
> +		netif_carrier_on(vi->dev);
> +		netif_wake_queue(vi->dev);
> +	} else {
> +		netif_carrier_off(vi->dev);
> +		netif_stop_queue(vi->dev);
> +	}

New status bits will screw this logic unless we count
on the host not to set them.  I suggest:

	/* Ignore unknown (future) status bits */
	v &= VIRTIO_NET_S_LINK_UP;

Cheers,
Rusty.
--
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