diff options
Diffstat (limited to 'regress/sys/net/pf_fragment/frag_cutnew.py')
-rw-r--r-- | regress/sys/net/pf_fragment/frag_cutnew.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/regress/sys/net/pf_fragment/frag_cutnew.py b/regress/sys/net/pf_fragment/frag_cutnew.py index fbbceecd019..261d2245688 100644 --- a/regress/sys/net/pf_fragment/frag_cutnew.py +++ b/regress/sys/net/pf_fragment/frag_cutnew.py @@ -25,14 +25,16 @@ class Sniff1(threading.Thread): self.packet = self.captured[0] dstaddr=sys.argv[1] -pid=os.getpid() & 0xffff +pid=os.getpid() +eid=pid & 0xffff payload="ABCDEFGHIJKLOMNO" dummy="01234567" -packet=IP(src=SRC_OUT, dst=dstaddr)/ICMP(id=pid)/payload +packet=IP(src=SRC_OUT, dst=dstaddr)/ICMP(type='echo-request', id=eid)/payload frag0=str(packet)[20:36] frag1=dummy+str(packet)[36:44] -pkt0=IP(src=SRC_OUT, dst=dstaddr, proto=1, id=pid, frag=0, flags='MF')/frag0 -pkt1=IP(src=SRC_OUT, dst=dstaddr, proto=1, id=pid, frag=1)/frag1 +fid=pid & 0xffff +pkt0=IP(src=SRC_OUT, dst=dstaddr, proto=1, id=fid, frag=0, flags='MF')/frag0 +pkt1=IP(src=SRC_OUT, dst=dstaddr, proto=1, id=fid, frag=1)/frag1 eth=[] eth.append(Ether(src=SRC_MAC, dst=PF_MAC)/pkt0) eth.append(Ether(src=SRC_MAC, dst=PF_MAC)/pkt1) @@ -51,7 +53,7 @@ if a and a.type == ETH_P_IP and \ icmptypes[a.payload.payload.type] == 'echo-reply': id=a.payload.payload.id print "id=%#x" % (id) - if id != pid: + if id != eid: print "WRONG ECHO REPLY ID" exit(2) load=a.payload.payload.payload.load |