Return 'unsupported-message-type if message type is unknown, return
'unsupported-message-class if message class is unknown. This makes it possible to parse replies that contain IP6 addresses in the additional section.
This commit is contained in:
parent
a65a5c5f86
commit
222f5c5052
|
@ -565,15 +565,26 @@
|
|||
(values (make-question name type class) start))))))
|
||||
|
||||
;; parses a resourcerecord in a message. returns the rr and the rest of the message.
|
||||
|
||||
(define (type-number->type type-number)
|
||||
(if (>= type-number (vector-length the-message-types))
|
||||
'unsupported-message-type
|
||||
(vector-ref the-message-types type-number)))
|
||||
|
||||
(define (class-number->class class-number)
|
||||
(if (>= class-number (vector-length the-message-classes))
|
||||
'unsupported-message-class
|
||||
(vector-ref the-message-classes class-number)))
|
||||
|
||||
(define (parse-rr start message)
|
||||
(call-with-values
|
||||
(lambda () (parse-name start message))
|
||||
(lambda (name start)
|
||||
(let ((type (vector-ref the-message-types
|
||||
(octet-pair->number (car start) (cadr start))))
|
||||
(let ((type (type-number->type
|
||||
(octet-pair->number (car start) (cadr start))))
|
||||
(start (cddr start)))
|
||||
(let ((class (vector-ref the-message-classes
|
||||
(octet-pair->number (car start) (cadr start))))
|
||||
(let ((class (class-number->class
|
||||
(octet-pair->number (car start) (cadr start))))
|
||||
(start (cddr start)))
|
||||
(let ((ttl (octet-quad->number (car start) (cadr start)
|
||||
(caddr start) (cadddr start)))
|
||||
|
|
Loading…
Reference in New Issue