summaryrefslogtreecommitdiff
path: root/src/dnsmasq-manager/tests/test-dnsmasq-utils.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-10-21 23:17:11 +0200
committerThomas Haller <thaller@redhat.com>2015-11-02 13:57:01 +0100
commit6c8aa669a4a6be86e29b45fc1a39aadcca9478b0 (patch)
tree3e19cad9c238c428ecc4469818da34f8f4926781 /src/dnsmasq-manager/tests/test-dnsmasq-utils.c
parentaa5b89a2ec8db5735925f78f3c91885a513ce51e (diff)
downloadNetworkManager-6c8aa669a4a6be86e29b45fc1a39aadcca9478b0.tar.gz
platform: properly handle IPv4 peer-addresses
The peer-address (IFA_ADDRESS) can also be all-zero (0.0.0.0). That is distinct from an usual address without explicit peer-address, which implicitly has the same peer and local address. Previously, we treated an all-zero peer_address as having peer and local address equal. This is especially grave, because the peer is part of the primary key for an IPv4 address. So we not only get a property of the address wrong, but we wrongly consider two different addresses as one and the same. To properly handle these addresses, we always must explicitly set the peer.
Diffstat (limited to 'src/dnsmasq-manager/tests/test-dnsmasq-utils.c')
-rw-r--r--src/dnsmasq-manager/tests/test-dnsmasq-utils.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/dnsmasq-manager/tests/test-dnsmasq-utils.c b/src/dnsmasq-manager/tests/test-dnsmasq-utils.c
index 98d308337f..04bf1b4d74 100644
--- a/src/dnsmasq-manager/tests/test-dnsmasq-utils.c
+++ b/src/dnsmasq-manager/tests/test-dnsmasq-utils.c
@@ -31,8 +31,7 @@ static NMPlatformIP4Address *
_set_addr (NMPlatformIP4Address *addr, const char *address, int plen)
{
memset (addr, 0, sizeof (*addr));
- addr->address = nmtst_inet4_from_string (address);
- addr->plen = plen;
+ nm_platform_ip4_address_set_addr (addr, nmtst_inet4_from_string (address), plen);
return addr;
}