git: if_vtnet - Fix potential vtnet_set_hwaddr call before virtqueues are set up.

Imre Vadasz ivadasz at crater.dragonflybsd.org
Sun Sep 10 15:30:35 PDT 2017


commit 216dcef0df73be65b8df15124fe87c388e390440
Author: Imre Vadász <imre at vdsz.com>
Date:   Mon Sep 11 00:21:24 2017 +0200

    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)

Summary of changes:
 sys/dev/virtual/virtio/net/if_vtnet.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/216dcef0df73be65b8df15124fe87c388e390440


-- 
DragonFly BSD source repository


More information about the Commits mailing list