farsightsec / wdns

low-level DNS library
Apache License 2.0
18 stars 5 forks source link

Fix handling of no address for client subnets #63

Closed kelvinatorr closed 1 year ago

kelvinatorr commented 1 year ago

Per RFC 7871: "ADDRESS is the rest “MUST be truncated to the number of bits indicated by the SOURCE PREFIX-LENGTH field”.

This change correctly handles if source is x00 and address is truncated completely. For ipv4 and ipv6 addresses. I also added unit tests to test specifically for this.