antonioribeiro / firewall

Firewall package for Laravel applications
BSD 3-Clause "New" or "Revised" License
1.39k stars 163 forks source link

Cannot set ranges (they are supposedly invalid IP addresses) #64

Closed hallosascha closed 7 years ago

hallosascha commented 7 years ago

When trying to add a range of IP addresses it fails, saying the range is not a valid IP address. For example I tried: Firewall::whiteList(10.0.0.1-10.0.0.255) or php artisan firewall:whitelist 10.0.0.1-10.0.0.255

Using the range that was provided in the readme. Also '127.0.0.1/255.255.255.255' is not working, whereas '192.168.17.0/24' is working (all examples from the readme).

I have enabled ranges. Looking at the code, it seems to me, that PragmaRX\Support\IpAddress::ipV4Valid() is only checking, if the given IP address is either already an IP address or a CIDR, but not if its a range. But this seems not to be the reason for '127.0.0.1/255.255.255.255' not working.

Am I doing something wrong or is this a bug?

Thank you for your time and help!

antonioribeiro commented 7 years ago

Should be fixed in the next version.