ipgen / rust

Official implementation of the IPGen Spec in Rust
MIT License
7 stars 2 forks source link

Netmask is not applied properly #4

Open rvbcldud opened 1 month ago

rvbcldud commented 1 month ago

There is an issue documented here that showcases a problem with how the netmask filters out the address range.

I think this has to do with how the network length is converted to a "character length." See here:

https://github.com/ipgen/rust/blob/041184c27e011bae9a9cfb3b21d25150b47c21e1/src/lib.rs#L75

In the aforementioned issue, a prefix length of 7 was given. The network_len would then be calculated as 1 "character," leaving 3 bits to be modified by the address rather than preserved by the netmask.

rvbcldud commented 1 month ago

I will be working on a significant rework that uses a bit system instead of a character system. Stay tuned, @rushmorem.

rvbcldud commented 1 month ago

Said rework has been completed in #5