freebsd-skq/sys/dev/virtio
kp ca237f7117 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 xen/virtio: fix balloon drivers to not mark pages as WIRED 2014-06-25 09:51:08 +00:00
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 Move the VIRTIO_RING_F_* defines out of virtqueue.h into virtio_config.h 2014-06-16 04:25:04 +00:00
virtio_ids.h Split the virtio.h header file into multiple files 2014-06-01 18:16:01 +00:00
virtio_if.m Add optional VirtIO device method for post-attach notifications 2013-09-01 04:20:23 +00:00
virtio_ring.h
virtio.c Split the virtio.h header file into multiple files 2014-06-01 18:16:01 +00:00
virtio.h Move the VIRTIO_RING_F_* defines out of virtqueue.h into virtio_config.h 2014-06-16 04:25:04 +00:00
virtqueue.c Add virtio bus 'poll' method allowing us to inform backend we are 2014-12-12 11:19:10 +00:00
virtqueue.h Add accessor to get the number of free descriptors in the virtqueue 2014-07-10 05:26:01 +00:00