summaryrefslogtreecommitdiff
path: root/regress/sys/netinet/arp/arp_broadcast.py
diff options
context:
space:
mode:
Diffstat (limited to 'regress/sys/netinet/arp/arp_broadcast.py')
-rw-r--r--regress/sys/netinet/arp/arp_broadcast.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/regress/sys/netinet/arp/arp_broadcast.py b/regress/sys/netinet/arp/arp_broadcast.py
new file mode 100644
index 00000000000..14b3c4f3b94
--- /dev/null
+++ b/regress/sys/netinet/arp/arp_broadcast.py
@@ -0,0 +1,22 @@
+#!/usr/local/bin/python2.7
+# send Address Resolution Protocol Request to Ethernet broadcast address
+# expect no answer
+
+import os
+from addr import *
+from scapy.all import *
+
+arp=ARP(op='who-has', hwsrc="ff:ff:ff:ff:ff:ff", psrc=LOCAL_ADDR,
+ hwdst="ff:ff:ff:ff:ff:ff", pdst=REMOTE_ADDR)
+eth=Ether(src=LOCAL_MAC, dst="ff:ff:ff:ff:ff:ff")/arp
+
+e=srp1(eth, iface=LOCAL_IF, timeout=2)
+
+if e and e.type == ETH_P_ARP:
+ a=e.payload
+ a.show()
+ print "ARP REPLY"
+ exit(1)
+
+print "no arp reply"
+exit(0)