title: What is the best way to fork scapy in order to duplicate packets
body: <p>I have a pretty simple script which supposed to duplicate packets using scapy:</p>
  
  <pre><code>from scapy.all import *
  import pprint
  
  ips = [
  "192.168.0.1",
  "192.168.0.2",
  "192.168.0.3",
  "192.168.0.4",
  "192.168.0.5",
  "192.168.0.6",
  "192.168.0.7"
  ]
  
  def dup_pkt(pkt):
          pprint.pprint(pkt)
          if pkt[IP].dst == "10.0.0.1":
                  for ip in ips:
                          pkt2 = copy.deepcopy(pkt)
                          pkt2[IP].dst = ip
                          print "Packet1:",pkt[IP].dst,"Packet2:",pkt2[IP].dst
                          send(pkt2)
  
  pkts = sniff(prn=dup_pkt, filter="port 53", store=0, count=2)
  </code></pre>
  
  <p>Instead of the for loop, I wish to send it to the multiple destination all at once. I thought about forking processes which each one will send the packets but it still leaves me with the for loop.</p>
  
  <p>Also - send() is very slow, but sendp() does not fit as I have different destinations.</p>
  
  <p>I've read this one: <a href="https://stackoverflow.com/questions/14247806/how-to-send-one-udp-packet-multiple-time-in-scapy">how to send one udp packet multiple time in scapy ?</a> but there is no answer there.</p>
  
  <p>How can I send multiple packets at once?</p>
  
  <p>Thanks</p>