ronin-rb / ronin-support

A support library for Ronin. Like activesupport, but for hacking!
https://ronin-rb.dev
GNU Lesser General Public License v3.0
26 stars 9 forks source link

Fix `IPRange::CIDR#first` and `IPRange::CIDR#last` to not return IPs ending in `.0` or `.255` #477

Closed postmodern closed 7 months ago

postmodern commented 7 months ago

Currently IPRange::CIDR#first returns A.B.C.0 for A.B.C.D/24, and IPRange::CIDR#last returns A.B.C.255 for A.B.C.D/24. However, IPRange::CIDR#each will skip .0 and .255 IP addresses. Have #first return A.B.C.1 and #last return A.B.C.254.