net/virtio-user: strip MAC feature when none specified
authorTiwei Bie <tiwei.bie@intel.com>
Fri, 11 May 2018 10:55:42 +0000 (18:55 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 17 May 2018 10:29:05 +0000 (12:29 +0200)
Currently VIRTIO_NET_F_MAC is set unconditionally when server
mode is used. It should be stripped when MAC isn't specified.

Fixes: bd8f50a45d0f ("net/virtio-user: support server mode")

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtio_user/virtio_user_dev.c

index 566c325..aff01f5 100644 (file)
@@ -421,6 +421,8 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
 
        if (dev->mac_specified)
                dev->device_features |= (1ull << VIRTIO_NET_F_MAC);
+       else
+               dev->device_features &= ~(1ull << VIRTIO_NET_F_MAC);
 
        if (cq) {
                /* device does not really need to know anything about CQ,