On 15 Apr 2015, at 14:39, Alan DeKok <aland@deployingradius.com> wrote:
On Apr 15, 2015, at 9:00 AM, Peter Balsianok <balsianok.peter@gmail.com> wrote:
It doesn`t work.
Ah... the RHS is cast to a network having /32, where the LHS is a /24. So they're not the same.
You'll have to do:
if (<cidr>&NAS-IP-Address < 213.151.231.0/24) { .. }
Which will work.
Yes, casting an IP address to a subnet creates a /32 or /128 subnet depending on the IP version. Looking through the PostgreSQL operators I don't think they're any cleaner. They've overloaded shift operators to do their subset/superset stuff. If people want to compare IP addresses numerically they can cast to integers and use the integer comparison operators. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS development team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2