From e1aabd5852da8f670ad8cfefcbcb9f25eb1c3d54 Mon Sep 17 00:00:00 2001 From: Teddy Engel Date: Fri, 5 Jun 2026 14:12:22 +0100 Subject: [PATCH] iflib: Fix panic when netmap VALE drops packets to iflib driver PR: 294726 Signed-off-by: Teddy Engel --- sys/net/iflib.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 0ad805cb7c1637..9d32a092926a6b 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -1051,6 +1051,19 @@ iflib_netmap_txsync(struct netmap_kring *kring, int flags) } if (!(slot->flags & NS_MOREFRAG)) { + /* + * Skip zero-length packets. Don't advance nic_i + * to avoid gaps in the NIC descriptor ring. + */ + if (seg_idx == 0) { + slot->flags &= ~(NS_REPORT | + NS_BUF_CHANGED); + nm_i = nm_next(nm_i, lim); + nic_i_start = -1; + flags = 0; + continue; + } + pi.ipi_len = pkt_len; pi.ipi_nsegs = seg_idx; pi.ipi_pidx = nic_i_start;