aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2019-03-12 21:35:42 -0700
committerDamjan Marion <dmarion@me.com>2019-03-13 08:21:37 +0000
commit39382976701926c1f34191c1311829c15a53cb01 (patch)
tree71033a91e86bd01d19e580796668980d21c4188b /src
parent295630deb6f0b8d1c131f6be3eedba4c7d209683 (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>
Diffstat (limited to 'src')
-rw-r--r--src/vnet/devices/virtio/vhost_user_input.c2
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 911fde03544..08fc3b1521a 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];