]> xenbits.xensource.com Git - libvirt.git/commit
network: validate network NAT range
authorLaine Stump <laine@laine.org>
Sat, 8 Aug 2015 21:46:41 +0000 (17:46 -0400)
committerLaine Stump <laine@laine.org>
Mon, 10 Aug 2015 17:06:56 +0000 (13:06 -0400)
commita6f9af8292b6462e509892b3a16acbcaaef61e4e
tree9df1edb0d7f303c27bfbbfe17c541d2828f69662
parentcf0404455cecb47ddbfa3266eea6b66f8540facd
network: validate network NAT range

This patch modifies virSocketAddrGetRange() to function properly when
the containing network/prefix of the address range isn't known, for
example in the case of the NAT range of a virtual network (since it is
a range of addresses on the *host*, not within the network itself). We
then take advantage of this new functionality to validate the NAT
range of a virtual network.

Extra test cases are also added to verify that virSocketAddrGetRange()
works properly in both positive and negative cases when the network
pointer is NULL.

This is the *real* fix for:

https://bugzilla.redhat.com/show_bug.cgi?id=985653

Commits 1e334a and 48e8b9 had earlier been pushed as fixes for that
bug, but I had neglected to read the report carefully, so instead of
fixing validation for the NAT range, I had fixed validation for the
DHCP range. sigh.
src/conf/network_conf.c
src/util/virsocketaddr.c
tests/sockettest.c