[netcf-devel] [PATCH] interface.rng: Fix ipv4-address regex

Laine Stump laine at laine.org
Mon Nov 15 18:40:22 UTC 2010


When the regex in ipv4-addr was copied for use in libvirt's
network.rng file, a reviewer pointed out that it allowed two digit
numbers with leading 0's. The new regex here doesn't allow that.
---
 data/xml/interface.rng |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/data/xml/interface.rng b/data/xml/interface.rng
index 80d686e..4dd1bb4 100644
--- a/data/xml/interface.rng
+++ b/data/xml/interface.rng
@@ -442,7 +442,7 @@
 
   <define name='ipv4-addr'>
     <data type='string'>
-      <param name="pattern">(((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2}))\.){3}((25[0-5])|(1[0-9]{2})|(2[0-4][0-9])|([0-9]{1,2}))</param>
+      <param name="pattern">(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([1-9][0-9])|([0-9]))</param>
     </data>
   </define>
 
-- 
1.7.2.3



More information about the netcf-devel mailing list