summaryrefslogtreecommitdiff
path: root/regress/sys/net/pf_fragment/frag6_cutnew.py
diff options
context:
space:
mode:
Diffstat (limited to 'regress/sys/net/pf_fragment/frag6_cutnew.py')
-rw-r--r--regress/sys/net/pf_fragment/frag6_cutnew.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/regress/sys/net/pf_fragment/frag6_cutnew.py b/regress/sys/net/pf_fragment/frag6_cutnew.py
index 4413d0668b3..300fb296627 100644
--- a/regress/sys/net/pf_fragment/frag6_cutnew.py
+++ b/regress/sys/net/pf_fragment/frag6_cutnew.py
@@ -2,12 +2,9 @@
# start of new fragment overlaps old one
# |--------|
-# |>>>>>----|
+# |XXXXX----|
-# If the tail of an older fragment overlaps the beginning of the
-# current fragment, cut the newer fragment.
-# m_adj(frent->fe_m, precut);
-# Newer data wins.
+# RFC 5722 drop overlapping fragments
import os
from addr import *
@@ -33,6 +30,9 @@ if os.fork() == 0:
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+dstaddr+" and dst "+SRC_OUT6+" and icmp6")
+if len(ans) == 0:
+ print "no reply"
+ exit(0)
a=ans[0]
if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
@@ -45,8 +45,9 @@ if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
data=a.payload.payload.data
print "payload=%s" % (data)
if data == payload:
- exit(0)
+ print "ECHO REPLY"
+ exit(1)
print "PAYLOAD!=%s" % (payload)
- exit(1)
+ exit(2)
print "NO ECHO REPLY"
exit(2)