File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -546,7 +546,7 @@ class ClientSubnetv4(StrLenField):
546546
547547 def getfield (self , pkt , s ):
548548 # type: (Packet, bytes) -> Tuple[bytes, I]
549- sz = operator .floordiv (self .length_from (pkt ), 8 )
549+ sz = operator .floordiv (self .length_from (pkt ) + 7 , 8 )
550550 sz = min (sz , operator .floordiv (self .af_length , 8 ))
551551 return s [sz :], self .m2i (pkt , s [:sz ])
552552
Original file line number Diff line number Diff line change @@ -516,3 +516,7 @@ assert p == eval(p.command())
516516pkt = DNSQR(qname=["domain1.com", "domain2.com"], qtype="A")
517517for i in pkt:
518518 assert i.qname in [b"domain1.com.", b"domain2.com."]
519+
520+ b = b'\x00\x08\x00\x0c\x00\x02=\x00+\xaf\xa3\xc4\xed\xeeW\xb8'
521+ p = EDNS0ClientSubnet(b)
522+ assert p.source_plen == 61 and p.address == '2baf:a3c4:edee:57b8::'
You can’t perform that action at this time.
0 commit comments