From 3c03564911d2e0b6e838fa40ba92716367bf17ed Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Mon, 15 Jan 2018 17:15:13 +0200 Subject: [PATCH] dhcp6: Fix valgrind nitpick about returned test case value Calling dhcp6_option_parse_address() will always return a value < 0 on error even though lt_valid remains unset. This is more than valgrind can safely detect, but let's fix the valgrind nitpick anyway. While fixing, use UINT32_MAX instead of ~0 on the same line. --- src/libsystemd-network/dhcp6-option.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsystemd-network/dhcp6-option.c b/src/libsystemd-network/dhcp6-option.c index 784a11d..7c6a6c4 100644 --- a/src/libsystemd-network/dhcp6-option.c +++ b/src/libsystemd-network/dhcp6-option.c @@ -358,7 +358,7 @@ int dhcp6_option_parse_ia(DHCP6Option *iaoption, DHCP6IA *ia) { int r = 0, status; uint16_t opt; size_t iaaddr_offset; - uint32_t lt_t1, lt_t2, lt_valid, lt_min = ~0; + uint32_t lt_t1, lt_t2, lt_valid = 0, lt_min = UINT32_MAX; assert_return(ia, -EINVAL); assert_return(!ia->addresses, -EINVAL); -- 2.7.4