Re: [PATCH v20 16/25] net/pcap: reduce scope of file-level variables

Bruce Richardson
2026-03-16T14:20:42Z

On Tue, Mar 10, 2026 at 09:09:54AM -0700, Stephen Hemminger wrote:
> Move errbuf from file scope to local variables in the two functions that
> use it (open_iface_live and open_single_rx_pcap). This avoids potential
> issues if these functions were called concurrently, since each call now
> has its own error buffer. Move iface_idx to a static local variable
> within pmd_init_internals(), the only function that uses it. The
> variable remains static to preserve the MAC address uniqueness counter
> across calls.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> Acked-by: Marat Khalili <marat.khalili@huawei.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>