File tree 2 files changed +9
-5
lines changed
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ from .._dns cimport (
38
38
DNSHinfo,
39
39
DNSNsec,
40
40
DNSPointer,
41
+ DNSQuestion,
41
42
DNSRecord,
42
43
DNSService,
43
44
DNSText,
@@ -48,11 +49,11 @@ cdef class DNSIncoming:
48
49
49
50
cdef bint _did_read_others
50
51
cdef public unsigned int flags
51
- cdef object offset
52
+ cdef cython.uint offset
52
53
cdef public bytes data
53
54
cdef unsigned int _data_len
54
55
cdef public cython.dict name_cache
55
- cdef public object questions
56
+ cdef public cython.list questions
56
57
cdef object _answers
57
58
cdef public object id
58
59
cdef public cython.uint num_questions
Original file line number Diff line number Diff line change @@ -211,9 +211,12 @@ def _read_header(self) -> None:
211
211
212
212
def _read_questions (self ) -> None :
213
213
"""Reads questions section of packet"""
214
- self .questions = [
215
- DNSQuestion (self ._read_name (), * self ._unpack (UNPACK_HH , 4 )) for _ in range (self .num_questions )
216
- ]
214
+ for _ in range (self .num_questions ):
215
+ name = self ._read_name ()
216
+ type_ , class_ = UNPACK_HH (self .data , self .offset )
217
+ self .offset += 4
218
+ question = DNSQuestion (name , type_ , class_ )
219
+ self .questions .append (question )
217
220
218
221
def _read_character_string (self ) -> bytes :
219
222
"""Reads a character string from the packet"""
You can’t perform that action at this time.
0 commit comments