Scapyにおける「WARNING: Mac address to reach destination not found」

2012年12月2日の日記で書いた方法で、Scapy による無線LAN(802.11)frame injection を実践していたところ、「WARNING: Mac address to reach destination not found」という警告メッセージが出力されました(下記参照)。このとき、Wireshark でパケットキャプチャしていも、802.11 フレームが送信されていませんでした。

root@bt:~# scapy
WARNING: No route found for IPv6 destination :: (no default route?)
Welcome to Scapy (2.0.1)
>>> send(RadioTap()/Dot11(addr1="ff:ff:ff:ff:ff",addr2="00:11:22:33:44:55",addr3="00:11:22:33:44:55")/Dot11Beacon(cap="ESS")/Dot11Elt(ID="SSID",info="scapy-frame-injection")/Dot11Elt(ID="Rates",info="\x82\x84\x0b\x16")/Dot11Elt(ID="DSset",info="\x06")/Dot11Elt(ID="TIM",info="\x00\x01\x00\x00"),iface="wlan1mon",loop=1,inter=1)
WARNING: Mac address to reach destination not found. Using broadcast.
.WARNING: Mac address to reach destination not found. Using broadcast.
.WARNING: more Mac address to reach destination not found. Using broadcast.
...WARNING: Mac address to reach destination not found. Using broadcast.
(snip)


この警告メッセージが出力された原因は、OSI 参照モデルにおける Layer 2 のプロトコルを編集したフレームを送信するために send() 関数を使用したことにありました。Layer 2 のプロトコルを編集したフレームを送信する場合、sendp() 関数を使用する必要があります。下記がマニュアルの該当部分の記述です。

The send() function will send packets at layer 3. That is to say it will handle routing and layer 2 for you. The sendp() function will work at layer 2.

Sending packets, Usage ― Scapy v2.1.1-dev documentation