Subject: Re: [PATCH net v1] selftests: bonding: add test for stacked bond header_parse recursion

From: Jakub Kicinski <[email-masked]>
Date: Mon, 16 Mar 2026 16:59:46 -0700

On Sun, 15 Mar 2026 18:40:51 +0800 Jiayuan Chen wrote:
> # Send a GRE packet so it arrives via gre -> bond0 -> bond1
> python3 -c "
> from scapy.all import *
> send(IP(src='10.0.0.2', dst='10.0.0.1')/GRE()/IP()/UDP(), verbose=0)
> "
> 
> But I wasn't sure if scapy is an acceptable dependency for selftests,
> and I also wasn't confident that tcpdump will always use AF_PACKET
> SOCK_DGRAM internally. So I ended up writing the Python script to
> handle both the SOCK_DGRAM listener and packet construction myself.
> 
> Is it fine to just inline a few lines like the scapy approach above,
> or would you prefer keeping it as a separate script?

The scapy two-liner format is fine to keep inline.

I personally don't really like scapy so we stayed away from it until
now. But for cases like this it seems like much lower maintenance
burden than separate tools so let's go ahead.