Tested-by: Andrew Bailey <[email protected]> Reviewed-by: Andrew Bailey <[email protected]>
On Tue, Mar 10, 2026 at 1:13 PM Patrick Robb <[email protected]> wrote: > Add a filter to the Scapy traffic generator sniffer which > forces the sniffer to ignore outbound traffic, preventing > double counting of packets. Without this change sniffing > will double count packets when DTS is being run with a > single link topology, because the Scapy packet transmission > and Scapy sniffing is happening on the same port. The > correct behavior is to only count inbound traffic which is > being returned to the traffic generator by the DTS SUT. > > Fixes: dfb667368077 ("dts: add Scapy asynchronous sniffer") > > Signed-off-by: Patrick Robb <[email protected]> > --- > dts/framework/testbed_model/traffic_generator/scapy.py | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/dts/framework/testbed_model/traffic_generator/scapy.py > b/dts/framework/testbed_model/traffic_generator/scapy.py > index 9e15a31c00..c6e9006205 100644 > --- a/dts/framework/testbed_model/traffic_generator/scapy.py > +++ b/dts/framework/testbed_model/traffic_generator/scapy.py > @@ -203,7 +203,7 @@ def _sniff(self, recv_port: Port) -> None: > ready_prompt = "Ready." > self.send_command( > "sniff(" > - f'iface="{recv_port.logical_name}", quiet=True, store=False, ' > + f'iface="{recv_port.logical_name}", filter="inbound", > quiet=True, store=False, ' > "prn=lambda p: bytes_base64(p.build()).decode(), " > f'started_callback=lambda: print("{ready_prompt}")' > ")", > -- > 2.49.0 > >

