]> git.ipfire.org Git - thirdparty/libvirt.git/commit
network: validate DHCP ranges are completely within defined network
authorLaine Stump <laine@laine.org>
Fri, 22 May 2015 21:32:02 +0000 (17:32 -0400)
committerLaine Stump <laine@laine.org>
Tue, 2 Jun 2015 16:40:07 +0000 (12:40 -0400)
commit1e334a0a000b70c8f0ab57d9fcaaa8cfc480759a
tree47f9a95a1f645a7e2bd6eba06f21580a098b7ebd
parent48e8b95d8ec3871d883e2f48f637b2f663e7b8fc
network: validate DHCP ranges are completely within defined network

virSocketAddrGetRange() has been updated to take the network address
and prefix, and now checks that both the start and end of the range
are within that network, thus validating that the entire range of
addresses is in the network. For IPv4, it also checks that ranges to
not start with the "network address" of the subnet, nor end with the
broadcast address of the subnet (this check doesn't apply to IPv6,
since IPv6 doesn't have a broadcast or network address)

Negative tests have been added to the network update and socket tests
to verify that bad ranges properly generate an error.

This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=985653
src/conf/network_conf.c
src/network/bridge_driver.c
src/util/virsocketaddr.c
src/util/virsocketaddr.h
tests/networkxml2xmlupdatein/dhcp-range-10.xml [new file with mode: 0644]
tests/networkxml2xmlupdatein/dhcp-range.xml
tests/networkxml2xmlupdateout/dhcp6host-routed-network-another-range.xml
tests/networkxml2xmlupdateout/dhcp6host-routed-network-range.xml
tests/networkxml2xmlupdatetest.c
tests/sockettest.c