Only deserialize header in error message
netlink/deserialize.scm
41 | 41 | (,RTM_NEWADDR . ,route:deserialize-addr-message) | |
42 | 42 | (,RTM_DELADDR . ,route:deserialize-addr-message) | |
43 | 43 | (,RTM_GETADDR . ,route:deserialize-addr-message)) | |
44 | + | (message-hdr ,deserialize-message-header '()) | |
44 | 45 | (link-attr ,(route:deserialize-route-attr 'link-attr) | |
45 | 46 | ,@route:%default-route-link-attr-decoder) | |
46 | 47 | (ipv4-attr ,(route:deserialize-route-attr 'ipv4-attr) |
netlink/message.scm
18 | 18 | (define-module (netlink message) | |
19 | 19 | #:use-module (ice-9 match) | |
20 | 20 | #:use-module (netlink data) | |
21 | + | #:use-module (netlink standard) | |
21 | 22 | #:use-module (rnrs bytevectors) | |
22 | 23 | #:use-module (srfi srfi-9) | |
23 | 24 | #:export (make-message | |
… | |||
27 | 28 | message-seq | |
28 | 29 | message-pid | |
29 | 30 | message-data | |
30 | - | deserialize-message)) | |
31 | + | deserialize-message | |
32 | + | deserialize-message-header)) | |
31 | 33 | ||
32 | 34 | (define-data-type message | |
33 | 35 | message-type-len | |
… | |||
64 | 66 | (if (< (data-size data) (- len 16)) | |
65 | 67 | (make-nl-data #f (const (- len 16)) (const (make-bytevector 0))) | |
66 | 68 | data))))) | |
69 | + | ||
70 | + | (define (deserialize-message-header decoder bv pos) | |
71 | + | (make-message | |
72 | + | (bytevector-u16-ref bv (+ pos 4) (native-endianness)) | |
73 | + | (bytevector-u16-ref bv (+ pos 6) (native-endianness)) | |
74 | + | (bytevector-u32-ref bv (+ pos 8) (native-endianness)) | |
75 | + | (bytevector-u32-ref bv (+ pos 12) (native-endianness)) | |
76 | + | no-data)) |
netlink/standard.scm
43 | 43 | (define (deserialize-error-message decoder bv pos) | |
44 | 44 | (make-error-message | |
45 | 45 | (bytevector-s32-ref bv pos (native-endianness)) | |
46 | - | (deserialize 'message decoder bv (+ pos 4)))) | |
46 | + | (deserialize 'message-hdr decoder (pk 'error-mrg bv) (+ pos 4)))) | |
47 | 47 | ||
48 | 48 | (define no-data | |
49 | 49 | (make-nl-data |