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

Bruce Richardson bruce.richardson at intel.com
Mon Mar 16 15:20:28 CET 2026


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 at networkplumber.org>
> Acked-by: Marat Khalili <marat.khalili at huawei.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson at intel.com>



More information about the dev mailing list