⬢ DragonFlyBSD Kernel Audit
DF-4236 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/netif/rl/if_rl.c
+++ b/sys/dev/netif/rl/if_rl.c
@@ -942,6 +942,13 @@
 		cd->rl_tx_chain[i] = NULL;
 		CSR_WRITE_4(sc, RL_TXADDR0 + (i * sizeof(uint32_t)),
 			    0x0000000);
+		/*
+		 * Clear stale completion/length bits so a re-init cannot
+		 * inherit descriptor state from the previous session
+		 * (DF-4236: missed TX completions after down/up churn).
+		 */
+		CSR_WRITE_4(sc, RL_TXSTAT0 + (i * sizeof(uint32_t)),
+			    0x0000000);
 	}
 
 	sc->rl_cdata.cur_tx = 0;