[libvirt] [PATCH 3/3] Do a better job of validating IP and MAC addresses in network.rng

Laine Stump laine at laine.org
Thu Nov 11 21:57:30 UTC 2010


On 11/11/2010 04:05 PM, Eric Blake wrote:
> On 11/11/2010 01:41 PM, Laine Stump wrote:
>> +<!-- An ipv4 "dotted quad" address -->
>> +<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>
> This allows 01.1.1.1 (leading zero looks unusual in an IPv4 address).  I
> would have done something like:
>
> (((25[0-5])|(2[0-4][0-9])|(1[0-9][0-9])|([1-9][0-9])|[0-9])\.){3}...
>

I see what you mean.

How about if I squash in the attached delta-diff?

(I'll send a patch for the same regex in interface.rng, the source of 
this one, separately).
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Fixup-ipv4-address-regex.patch
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101111/adbda9bf/attachment-0001.ksh>


More information about the libvir-list mailing list