Closed kristapsdz closed 7 years ago
That would be nice to have.
See enclosed. This parses EDNS (T_OPT) queries and recognises one of them. On debug output, it notes:
pkt_parse_rr: OPT: EDNSD0 'Owner'
Or if the code type is unknown (see the list for all codes):
pkt_parse_rr: OPT: 14 bytes in RDATA section 0, code 4
I still get the following error message, though, with this new parsing in place:
Unprocessed rr in Additional Section
This is now a pull request.
I'd noticed lots of invalid packet classes (packet.c, pkt_parse_rr() checking rr->rrs.class) on my machine. Turns out this comes from T_OPT packets, which are different from others.
I'm still working on a patch, but in short, rr->rrs.type needs to be checked for T_OPT (41) before reading for cacheflush and rr->rrs.class. (I.e., after the dname read, which will be blank.) Otherwise, these values are not meaningful, as the T_OPT (RFC 2671) doesn't set the fields appropriately.