mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: Gate VIRTIO_NET_S_ANNOUNCE on feature acked
Only set the VIRTIO_NET_S_ANNOUNCE status bit if the feature VIRTIO_NET_F_GUEST_ANNOUNCE was acknowledged. Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
@@ -766,7 +766,11 @@ impl Net {
|
||||
if self.common.feature_acked(VIRTIO_NET_F_STATUS.into()) {
|
||||
status |= VIRTIO_NET_S_LINK_UP as u16;
|
||||
|
||||
if self.announce.pending.load(Ordering::Acquire) {
|
||||
if self
|
||||
.common
|
||||
.feature_acked(VIRTIO_NET_F_GUEST_ANNOUNCE.into())
|
||||
&& self.announce.pending.load(Ordering::Acquire)
|
||||
{
|
||||
status |= VIRTIO_NET_S_ANNOUNCE as u16;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,7 +272,12 @@ impl Net {
|
||||
{
|
||||
status |= VIRTIO_NET_S_LINK_UP as u16;
|
||||
|
||||
if self.announce.pending.load(Ordering::Acquire) {
|
||||
if self
|
||||
.vu_common
|
||||
.virtio_common
|
||||
.feature_acked(VIRTIO_NET_F_GUEST_ANNOUNCE.into())
|
||||
&& self.announce.pending.load(Ordering::Acquire)
|
||||
{
|
||||
status |= VIRTIO_NET_S_ANNOUNCE as u16;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user