From ea929418c6c539fe6aa6506e520c5fe8fe68559f Mon Sep 17 00:00:00 2001
From: David Schmitt <david.schmitt@puppet.com>
Date: Tue, 25 Oct 2016 15:28:40 +0100
Subject: (MODULES-3980) Fix ipv4 regex validator

This also updates all ipv4 tests to use the same test data for better
comparability. Closes #676, #679

Fix-Originally-By: Nate Potter <nathaniel.potter@intel.com>
---
 types/compat/ipv4.pp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'types/compat')

diff --git a/types/compat/ipv4.pp b/types/compat/ipv4.pp
index 1d72ebd..a0ba0d6 100644
--- a/types/compat/ipv4.pp
+++ b/types/compat/ipv4.pp
@@ -1,2 +1,2 @@
 # Emulate the validate_ipv4_address and is_ipv4_address functions
-type Stdlib::Compat::Ipv4 = Pattern[/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/]
+type Stdlib::Compat::Ipv4 = Pattern[/^((([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))[.]){3}([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d)))(\/((([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))[.]){3}([0-9](?!\d)|[1-9][0-9](?!\d)|1[0-9]{2}(?!\d)|2[0-4][0-9](?!\d)|25[0-5](?!\d))|[0-9]+))?$/]
-- 
cgit v1.2.3