diff options
author | Steven Luong <sluong@cisco.com> | 2019-03-12 21:35:42 -0700 |
---|---|---|
committer | steven luong <sluong@cisco.com> | 2019-03-13 14:11:53 +0000 |
commit | 7e5735d31274ed281aba9785667c2472cacdcc5f (patch) | |
tree | 717e497d7187fcae84b6404283d309a4ac407854 /src/vnet/devices/virtio | |
parent | 22e1f1d136790f1ee974ace7e299492582921b66 (diff) |
vhost-user: restart vpp may cause vhost to crash
Fix a typo in vhost_user_rx_discard_packet which may cause
txvq->last_avail_idx to go wild.
Change-Id: Ifaeb58835dff9b7ea82c061442722f1dcaa5d9a4
Signed-off-by: Steven Luong <sluong@cisco.com>
(cherry picked from commit 39382976701926c1f34191c1311829c15a53cb01)
Diffstat (limited to 'src/vnet/devices/virtio')
-rw-r--r-- | src/vnet/devices/virtio/vhost_user_input.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vnet/devices/virtio/vhost_user_input.c b/src/vnet/devices/virtio/vhost_user_input.c index d7f628c4c1a..79c66eecd90 100644 --- a/src/vnet/devices/virtio/vhost_user_input.c +++ b/src/vnet/devices/virtio/vhost_user_input.c @@ -200,7 +200,7 @@ vhost_user_rx_discard_packet (vlib_main_t * vm, u16 last_used_idx = txvq->last_used_idx; while (discarded_packets != discard_max) { - if (avail_idx == txvq->last_avail_idx) + if (avail_idx == last_avail_idx) goto out; u16 desc_chain_head = txvq->avail->ring[last_avail_idx & mask]; |