MCPcopy Index your code
hub / github.com/secdev/scapy / na_reply_callback

Function na_reply_callback

scapy/layers/inet6.py:3719–3733  ·  view source on GitHub ↗

Callback that reply to a NS with a NA

(req, reply_mac, iface)

Source from the content-addressed store, hash-verified

3717 """
3718
3719 def na_reply_callback(req, reply_mac, iface):
3720 """
3721 Callback that reply to a NS with a NA
3722 """
3723
3724 # Let's build a reply and send it
3725 mac = req[Ether].src
3726 dst = req[IPv6].dst
3727 tgt = req[ICMPv6ND_NS].tgt
3728 rep = Ether(src=reply_mac) / IPv6(src=tgt, dst=dst)
3729 rep /= ICMPv6ND_NA(tgt=tgt, S=0, R=0, O=1) # noqa: E741
3730 rep /= ICMPv6NDOptDstLLAddr(lladdr=reply_mac)
3731 sendp(rep, iface=iface, verbose=0)
3732
3733 print("Reply NA for target address %s (received from %s)" % (tgt, mac))
3734
3735 _NDP_Attack_DAD_DoS(na_reply_callback, iface, mac_src_filter,
3736 tgt_filter, reply_mac)

Callers

nothing calls this directly

Calls 5

EtherClass · 0.90
sendpFunction · 0.90
IPv6Class · 0.85
ICMPv6ND_NAClass · 0.85

Tested by

no test coverage detected