summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-03-31 11:19:45 +0200
committerThomas Haller <thaller@redhat.com>2014-06-06 20:01:37 +0200
commitd90b9ff2c855bf4350070957a72b267f7edb7898 (patch)
tree597023fe08a64140434f334a547bf8fff7a10fe6
parent84cfd06d6a7df892615f107190848c078e0e6705 (diff)
platform: fix setting preferred time for address
Before nm_platform_ip4_address_sync() set the preferred time to the same value as the address lifetime. The result was that the preferred time was always identical to valid lifetime. This will lead to the kernel using the address longer then the desired preferred time (until validity of the address expires). https://bugzilla.redhat.com/show_bug.cgi?id=1082041 https://bugzilla.redhat.com/show_bug.cgi?id=1083283 Reported-by: Kai Engert <kengert@redhat.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r--src/platform/nm-platform.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
index e43f3033f2..3993d59341 100644
--- a/src/platform/nm-platform.c
+++ b/src/platform/nm-platform.c
@@ -1611,7 +1611,7 @@ nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses)
guint32 shift = subtract_guint32 (now, known_address->timestamp + 5);
lifetime = subtract_guint32 (known_address->lifetime, shift);
- preferred = subtract_guint32 (known_address->lifetime, shift);
+ preferred = subtract_guint32 (known_address->preferred, shift);
g_warn_if_fail (known_address->preferred <= known_address->lifetime);
} else
@@ -1670,7 +1670,7 @@ nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses)
guint32 shift = subtract_guint32 (now, known_address->timestamp + 5);
lifetime = subtract_guint32 (known_address->lifetime, shift);
- preferred = subtract_guint32 (known_address->lifetime, shift);
+ preferred = subtract_guint32 (known_address->preferred, shift);
g_warn_if_fail (known_address->preferred <= known_address->lifetime);
} else