Skip to content

add extended functions to test IP ranges

Maxime Besson requested to merge fix-cidr-match-2903 into v2.0

This PR fixes #2903 (closed) by providing two new functions

  • ipInNetwork:
   ipInNetwork($ENV{REMOTE_ADDR}, '127.0.0.0/8')
   ipInNetwork($ENV{REMOTE_ADDR}, '10.0.0.0/8', '192.168.0.0/16')
  • inNetwork (same but implicitely tests REMOTE_ADDR):
   inNetwork('127.0.0.0/8')
   inNetwork('10.0.0.0/8', '192.168.0.0/16')

New dependency: Net::CIDR (found in Debian and EPEL)

works in Safe Jail

maybe we should deprecate isInNet6 ?

Merge request reports

Loading