]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r344696:
authorVincenzo Maffione <vmaffione@FreeBSD.org>
Fri, 8 Mar 2019 08:26:06 +0000 (08:26 +0000)
committerVincenzo Maffione <vmaffione@FreeBSD.org>
Fri, 8 Mar 2019 08:26:06 +0000 (08:26 +0000)
commitce02ccc998df02bfac450677b11f8fbb8a30f5e7
treeb745510ed23705da70ef81489f32cfe1edb8ef69
parentd7f9232ff3a4c27307e52f120078069b50495dfb
MFC r344696:

netmap: pkt-gen: fix bug in send_packets()

The send_packets() function was using ring->cur as index to scan
the transmit ring. This function may also set ring->cur ahead of
ring->head, in case no more slots are available. However, the function
also uses nm_ring_space() which looks at ring->head to check how many
slots are available. If ring->head and ring->cur are different, this
results in pkt-gen advancing ring->cur beyond ring->tail.

This patch fixes send_packets() (and similar source locations) to
use ring->head as a index, rather than using ring->cur.
tools/tools/netmap/pkt-gen.c