<div dir="ltr">Tested-by: Andrew Bailey <<a href="mailto:abailey@iol.unh.edu">abailey@iol.unh.edu</a>><br>Reviewed-by: Andrew Bailey <<a href="mailto:abailey@iol.unh.edu">abailey@iol.unh.edu</a>></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Mar 10, 2026 at 1:13 PM Patrick Robb <<a href="mailto:probb@iol.unh.edu">probb@iol.unh.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Add a filter to the Scapy traffic generator sniffer which<br>
forces the sniffer to ignore outbound traffic, preventing<br>
double counting of packets. Without this change sniffing<br>
will double count packets when DTS is being run with a<br>
single link topology, because the Scapy packet transmission<br>
and Scapy sniffing is happening on the same port. The<br>
correct behavior is to only count inbound traffic which is<br>
being returned to the traffic generator by the DTS SUT.<br>
<br>
Fixes: dfb667368077 ("dts: add Scapy asynchronous sniffer")<br>
<br>
Signed-off-by: Patrick Robb <<a href="mailto:probb@iol.unh.edu" target="_blank">probb@iol.unh.edu</a>><br>
---<br>
 dts/framework/testbed_model/traffic_generator/scapy.py | 2 +-<br>
 1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/dts/framework/testbed_model/traffic_generator/scapy.py b/dts/framework/testbed_model/traffic_generator/scapy.py<br>
index 9e15a31c00..c6e9006205 100644<br>
--- a/dts/framework/testbed_model/traffic_generator/scapy.py<br>
+++ b/dts/framework/testbed_model/traffic_generator/scapy.py<br>
@@ -203,7 +203,7 @@ def _sniff(self, recv_port: Port) -> None:<br>
         ready_prompt = "Ready."<br>
         self.send_command(<br>
             "sniff("<br>
-            f'iface="{recv_port.logical_name}", quiet=True, store=False, '<br>
+            f'iface="{recv_port.logical_name}", filter="inbound", quiet=True, store=False, '<br>
             "prn=lambda p: bytes_base64(p.build()).decode(), "<br>
             f'started_callback=lambda: print("{ready_prompt}")'<br>
             ")",<br>
-- <br>
2.49.0<br>
<br>
</blockquote></div>