]> git.ipfire.org Git - thirdparty/libvirt.git/commit
lxc: use correct prefix when setting veth IP address
authorLaine Stump <laine@laine.org>
Tue, 26 Apr 2016 18:27:08 +0000 (14:27 -0400)
committerLaine Stump <laine@laine.org>
Sun, 26 Jun 2016 23:33:08 +0000 (19:33 -0400)
commit70a2c7e06274ed95a5964fac0199c6ec2e52b318
tree339846369d306a42ec5cb82893f418268930d296
parentf03a4a2a96c2f3b0c8c5dc82280f361201ac8575
lxc: use correct prefix when setting veth IP address

Commit c9a641 (first appearred in 1.2.12) added support for setting
the guest-side IP address of veth devices in lxc domains.
Unfortunately, it hardcoded the assumption that the proper prefix for
any IP address with no explicit prefix in the config should be "24";
that is only correct for class C IPv4 addresses, but not for any other
IPv4 address, nor for any IPv6 address.

The good news is that there is already a function in libvirt that will
determine the proper default prefix for any IP address. This patch
replaces the use of the ill-fated VIR_SOCKET_ADDR_DEFAULT_PREFIX with
calls to virSocketAddrGetIPPrefix().
src/lxc/lxc_container.c
src/util/virsocketaddr.h