title: Scapy, IndexError: Layer [Dot11] not found
body: <p>I am trying to send a HTTP response using scapy. I sniff out an request and then attempt to fabricate a response. I am basing this off the code in <a href="https://stackoverflow.com/questions/22752467/create-spoofing-http-response-in-wireless-lan-with-scapy">this</a> question. Here is the code that is causing problems:</p>
  <pre><code>import scapy.all as scapy
  from scapy.layers.http import HTTPRequest
  from scapy.layers.dot11 import RadioTap
  from scapy.layers.dot11 import Dot11
  packets = scapy.sniff(count=30)
      for i in range(len(packets)):
          if packets[i].haslayer(HTTPRequest):
              pkt = packets[i]
              dot11_frame = RadioTap()/Dot11(
                  type = &quot;Data&quot;,
                  FCfield = &quot;from-DS&quot;,
                  addr1 = pkt[scapy.Dot11].addr2,
                  addr2 = pkt[scapy.Dot11].addr1,
                  addr3 = pkt[scapy.Dot11].addr1,
                  )
  </code></pre>
  <p>After I sniff the packet and get all the information required I do what the other guy did, and the problem is that I keep on getting this error with the part defining dot11_frame, <code>IndexError: Layer [Dot11] not found</code>, this happens when the line <code>addr1 = pkt[scapy.Dot11].addr2</code> is run. I have not even done a wildcard import like <a href="https://stackoverflow.com/questions/56154506/scapy-dot11-not-found">some</a> answers suggested. So how do I fix this error?</p>