DragonFlyBSD Kernel Audit
DF-0358 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/net/netmap/netmap.c b/sys/net/netmap/netmap.c
--- a/sys/net/netmap/netmap.c
+++ b/sys/net/netmap/netmap.c
@@ -737,7 +737,7 @@
 	if (n > 0) {
 		if (k < n)
 			k += kring->nkr_num_slots;
-		k += n;
+		k -= n;
 	}
 	for (n = kring->nr_hwcur; n != k;) {
 		struct netmap_slot *slot = &kring->ring->slot[n];