[NetworkManager/f20] additional fixes
thaller
thaller at fedoraproject.org
Mon Feb 24 17:37:08 UTC 2014
commit 94517a47877e250b0c32d3ce4cde1a3406a47c43
Author: Thomas Haller <thaller at redhat.com>
Date: Mon Feb 17 11:14:00 2014 +0100
additional fixes
0047-fix-address-timestamps-in-platform.patch | 60 +++++++++++++++++++++++++
NetworkManager.spec | 7 +++-
2 files changed, 66 insertions(+), 1 deletions(-)
---
diff --git a/0047-fix-address-timestamps-in-platform.patch b/0047-fix-address-timestamps-in-platform.patch
new file mode 100644
index 0000000..a27f42e
--- /dev/null
+++ b/0047-fix-address-timestamps-in-platform.patch
@@ -0,0 +1,60 @@
+From 739faab9f5d8c2b5542da733df6fece45f8873d6 Mon Sep 17 00:00:00 2001
+From: Thomas Haller <thaller at redhat.com>
+Date: Thu, 16 Jan 2014 20:20:35 +0100
+Subject: [PATCH 1/1] core/platform: fix wrong calculation of address
+ lifetime/preferred for kernel addresses
+
+When receiving an IPv4/IPv6 address from the kernel, platform set the
+timestamp to an invalid value before. The address timestamp must be set
+to *now*, because the lifetime and preferred arguments are counting from
+now.
+
+(cherry picked from commit 177c767320578c490ff94e723115d830d1753ae1)
+
+Signed-off-by: Thomas Haller <thaller at redhat.com>
+---
+ src/platform/nm-linux-platform.c | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
+index 55646d4..b5e3618 100644
+--- a/src/platform/nm-linux-platform.c
++++ b/src/platform/nm-linux-platform.c
+@@ -834,6 +834,16 @@ hack_empty_master_iff_lower_up (NMPlatform *platform, struct nl_object *object)
+ rtnl_link_unset_flags (rtnllink, IFF_LOWER_UP);
+ }
+
++static guint32
++get_time (void)
++{
++ struct timespec tp;
++
++ clock_gettime (CLOCK_MONOTONIC, &tp);
++
++ return tp.tv_sec;
++}
++
+ static void
+ init_ip4_address (NMPlatformIP4Address *address, struct rtnl_addr *rtnladdr)
+ {
+@@ -846,7 +856,7 @@ init_ip4_address (NMPlatformIP4Address *address, struct rtnl_addr *rtnladdr)
+
+ address->ifindex = rtnl_addr_get_ifindex (rtnladdr);
+ address->plen = rtnl_addr_get_prefixlen (rtnladdr);
+- address->timestamp = rtnl_addr_get_create_time (rtnladdr);
++ address->timestamp = get_time ();
+ address->lifetime = rtnl_addr_get_valid_lifetime (rtnladdr);
+ address->preferred = rtnl_addr_get_preferred_lifetime (rtnladdr);
+ g_assert (nl_addr_get_len (nladdr) == sizeof (address->address));
+@@ -867,7 +877,7 @@ init_ip6_address (NMPlatformIP6Address *address, struct rtnl_addr *rtnladdr)
+
+ address->ifindex = rtnl_addr_get_ifindex (rtnladdr);
+ address->plen = rtnl_addr_get_prefixlen (rtnladdr);
+- address->timestamp = rtnl_addr_get_create_time (rtnladdr);
++ address->timestamp = get_time ();
+ address->lifetime = rtnl_addr_get_valid_lifetime (rtnladdr);
+ address->preferred = rtnl_addr_get_preferred_lifetime (rtnladdr);
+ address->flags = rtnl_addr_get_flags (rtnladdr);
+--
+1.8.5.3
+
diff --git a/NetworkManager.spec b/NetworkManager.spec
index c6e0133..19a149c 100644
--- a/NetworkManager.spec
+++ b/NetworkManager.spec
@@ -42,7 +42,7 @@ Name: NetworkManager
Summary: Network connection manager and user applications
Epoch: 1
Version: 0.9.9.0
-Release: 30%{snapshot}%{?dist}
+Release: 31%{snapshot}%{?dist}
Group: System Environment/Base
License: GPLv2+
URL: http://www.gnome.org/projects/NetworkManager/
@@ -97,6 +97,7 @@ Patch43: NM-before-network-service.patch
Patch44: 0044-ipv6-privacy.patch
Patch45: 0045-platform-caching.patch
Patch46: 0046-suppress-invalid-warnings.patch
+Patch47: 0047-fix-address-timestamps-in-platform.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -308,6 +309,7 @@ by nm-connection-editor and nm-applet in a non-graphical environment.
%patch44 -p1 -b .0044-ipv6-privacy.orig
%patch45 -p1 -b .0045-platform-caching.orig
%patch46 -p1 -b .0046-suppress-invalid-warnings.orig
+%patch47 -p1 -b .0047-fix-address-timestamps-in-platform.orig
%build
@@ -532,6 +534,9 @@ fi
%endif
%changelog
+* Mon Feb 24 2014 Thomas Haller <thaller at redhat.com> - 0.9.9.0-31.git20131003
+- fix timestamps for addresses received from kernel/platform
+
* Sun Feb 16 2014 Thomas Haller <thaller at redhat.com> - 0.9.9.0-30.git20131003
- revert previous snapshot release 0.9.9.0-29.git20140131, instead based on 0.9.9.0-28.git20131003
- support for ipv6 private addresses (rfc4941) (rh #1047139)
More information about the scm-commits
mailing list