freebsd-skq/sys/dev/virtio
Kristof Provost 581e697036 Fix panic when adding vtnet interfaces to a bridge
vtnet interfaces are always in promiscuous mode (at least if the
VIRTIO_NET_F_CTRL_RX feature is not negotiated with the host).  if_promisc() on
a vtnet interface returned ENOTSUP although it has IFF_PROMISC set. This
confused the bridge code. Instead we now accept all enable/disable promiscuous
commands (and always keep IFF_PROMISC set).

There are also two issues with the if_bridge error handling.

If if_promisc() fails it uses bridge_delete_member() to clean up. This tries to
disable promiscuous mode on the interface. That runs into an assert, because
promiscuous mode was never set in the first place. (That's the panic reported in
PR 200210.)
We can only unset promiscuous mode if the interface actually is promiscuous.
This goes against the reference counting done by if_promisc(), but only the
first/last if_promic() calls can actually fail, so this is safe.

A second issue is a double free of bif. It's already freed by
bridge_delete_member().

PR:		200210
Differential Revision:	https://reviews.freebsd.org/D2804
Reviewed by:	philip (mentor)
2015-06-13 19:39:21 +00:00
..
balloon
block Do not report stripe size if it is equal to sector size. 2015-04-18 19:37:37 +00:00
console Several minor changes to hopefully complete the VirtIO console driver 2014-11-07 03:36:28 +00:00
mmio Hide virtio features negotiation messages under bootverbose. 2015-03-15 21:00:10 +00:00
network Fix panic when adding vtnet interfaces to a bridge 2015-06-13 19:39:21 +00:00
pci Hide virtio features negotiation messages under bootverbose. 2015-03-15 21:00:10 +00:00
random CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than ten 2015-05-22 17:05:21 +00:00
scsi Prevent overflow issues in timeout processing 2014-11-21 21:01:24 +00:00
virtio_bus_if.m Add virtio bus 'poll' method allowing us to inform backend we are 2014-12-12 11:19:10 +00:00
virtio_config.h
virtio_ids.h
virtio_if.m
virtio_ring.h
virtio.c
virtio.h
virtqueue.c Add virtio bus 'poll' method allowing us to inform backend we are 2014-12-12 11:19:10 +00:00
virtqueue.h