if_vtnet - Fix potential vtnet_set_hwaddr call before virtqueues are set up.
authorImre Vadász <imre@vdsz.com>
Sun, 10 Sep 2017 22:21:24 +0000 (00:21 +0200)
committerImre Vadász <imre@vdsz.com>
Sun, 10 Sep 2017 22:21:24 +0000 (00:21 +0200)
commit216dcef0df73be65b8df15124fe87c388e390440
tree410086320f63b2e591020e004fd44cd602549eb3
parent80776208bd68d4488dd984f7f98ff1cf1c335da1
if_vtnet - Fix potential vtnet_set_hwaddr call before virtqueues are set up.

* When VIRTIO_NET_F_MAC isn't negotiated (i.e. the host doesn't give us
  a macaddress), we generate a random mac address. The vtnet_set_hwaddr()
  call to set this mac address, would have tried to use the control
  virtqueue too early, where it isn't yet allocated.

* To fix this case, do the vtnet_set_hwaddr() call for this a bit later,
  after the virtqueues have been set up. (We are already disabling
  promiscuous mode there, so we know the controlq is working there)
sys/dev/virtual/virtio/net/if_vtnet.c