Update to 1.0.2 release
This commit is contained in:
parent
87260524cc
commit
46c1d97ea6
1
.gitignore
vendored
1
.gitignore
vendored
@ -309,3 +309,4 @@ network-manager-applet-0.8.1.tar.bz2
|
||||
/NetworkManager-0.9.9.98.git20140620.63b0a2f5.tar.bz2
|
||||
/NetworkManager-0.9.10.0.git20140704.6eb82acd.tar.bz2
|
||||
/NetworkManager-1.0.0.tar.xz
|
||||
/NetworkManager-1.0.2.tar.xz
|
||||
|
@ -1,32 +0,0 @@
|
||||
From 46c836e5cd5342cab5dfb4cd6eb5daf6170b70a0 Mon Sep 17 00:00:00 2001
|
||||
From: Dan Williams <dcbw@redhat.com>
|
||||
Date: Mon, 16 Mar 2015 10:44:16 -0500
|
||||
Subject: [PATCH] connectivity: disable HTTP keepalive for connectivity checks
|
||||
|
||||
There won't be any further requests, so there's no point in keeping
|
||||
the connection alive. Even if the HTTP server doesn't care, proxy
|
||||
servers in-between might keep the connection open for a couple seconds
|
||||
for keepalive, and we might as well be nice to them and tell them we
|
||||
don't need to keep it alive.
|
||||
|
||||
(cherry picked from commit 90692e3efff398f0e4420827fc6d7ac342360e5c)
|
||||
---
|
||||
src/nm-connectivity.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/nm-connectivity.c b/src/nm-connectivity.c
|
||||
index 4d5feef..85bd70a 100644
|
||||
--- a/src/nm-connectivity.c
|
||||
+++ b/src/nm-connectivity.c
|
||||
@@ -247,6 +247,8 @@ nm_connectivity_check_async (NMConnectivity *self,
|
||||
if (priv->uri && priv->interval) {
|
||||
msg = soup_message_new ("GET", priv->uri);
|
||||
soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT);
|
||||
+ /* Disable HTTP/1.1 keepalive; the connection should not persist */
|
||||
+ soup_message_headers_append (msg->request_headers, "Connection", "close");
|
||||
soup_session_queue_message (priv->soup_session,
|
||||
msg,
|
||||
nm_connectivity_check_cb,
|
||||
--
|
||||
2.1.0
|
||||
|
@ -1,83 +0,0 @@
|
||||
From cdf17af6579a6ddebc1a76affbfa756432bc6bfa Mon Sep 17 00:00:00 2001
|
||||
From: Lubomir Rintel <lkundrak@v3.sk>
|
||||
Date: Wed, 28 Jan 2015 12:00:00 +0100
|
||||
Subject: [PATCH] ip6-config: remove the link-local address on address flush
|
||||
|
||||
If it stays after device dispose a connection is assumed.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1184997
|
||||
(cherry picked from commit 6771f836ce3518bc75f0cbbed74138f40c890f7d)
|
||||
---
|
||||
src/nm-ip6-config.c | 2 +-
|
||||
src/platform/nm-platform.c | 7 ++++---
|
||||
src/platform/nm-platform.h | 2 +-
|
||||
3 files changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c
|
||||
index db64e72..63b4260 100644
|
||||
--- a/src/nm-ip6-config.c
|
||||
+++ b/src/nm-ip6-config.c
|
||||
@@ -375,7 +375,7 @@ nm_ip6_config_commit (const NMIP6Config *config, int ifindex)
|
||||
g_return_val_if_fail (config != NULL, FALSE);
|
||||
|
||||
/* Addresses */
|
||||
- nm_platform_ip6_address_sync (ifindex, priv->addresses);
|
||||
+ nm_platform_ip6_address_sync (ifindex, priv->addresses, TRUE);
|
||||
|
||||
/* Routes */
|
||||
{
|
||||
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
|
||||
index 14fc44c..f679fe5 100644
|
||||
--- a/src/platform/nm-platform.c
|
||||
+++ b/src/platform/nm-platform.c
|
||||
@@ -1826,6 +1826,7 @@ nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses, guint3
|
||||
* nm_platform_ip6_address_sync:
|
||||
* @ifindex: Interface index
|
||||
* @known_addresses: List of addresses
|
||||
+ * @keep_link_local: Don't remove link-local address
|
||||
*
|
||||
* A convenience function to synchronize addresses for a specific interface
|
||||
* with the least possible disturbance. It simply removes addresses that are
|
||||
@@ -1834,7 +1835,7 @@ nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses, guint3
|
||||
* Returns: %TRUE on success.
|
||||
*/
|
||||
gboolean
|
||||
-nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses)
|
||||
+nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses, gboolean keep_link_local)
|
||||
{
|
||||
GArray *addresses;
|
||||
NMPlatformIP6Address *address;
|
||||
@@ -1847,7 +1848,7 @@ nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses)
|
||||
address = &g_array_index (addresses, NMPlatformIP6Address, i);
|
||||
|
||||
/* Leave link local address management to the kernel */
|
||||
- if (IN6_IS_ADDR_LINKLOCAL (&address->address))
|
||||
+ if (keep_link_local && IN6_IS_ADDR_LINKLOCAL (&address->address))
|
||||
continue;
|
||||
|
||||
if (!array_contains_ip6_address (known_addresses, address))
|
||||
@@ -1880,7 +1881,7 @@ gboolean
|
||||
nm_platform_address_flush (int ifindex)
|
||||
{
|
||||
return nm_platform_ip4_address_sync (ifindex, NULL, 0)
|
||||
- && nm_platform_ip6_address_sync (ifindex, NULL);
|
||||
+ && nm_platform_ip6_address_sync (ifindex, NULL, FALSE);
|
||||
}
|
||||
|
||||
/******************************************************************/
|
||||
diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h
|
||||
index 3f37ed6..62eb0f4 100644
|
||||
--- a/src/platform/nm-platform.h
|
||||
+++ b/src/platform/nm-platform.h
|
||||
@@ -572,7 +572,7 @@ gboolean nm_platform_ip6_address_delete (int ifindex, struct in6_addr address, i
|
||||
gboolean nm_platform_ip4_address_exists (int ifindex, in_addr_t address, int plen);
|
||||
gboolean nm_platform_ip6_address_exists (int ifindex, struct in6_addr address, int plen);
|
||||
gboolean nm_platform_ip4_address_sync (int ifindex, const GArray *known_addresses, guint32 device_route_metric);
|
||||
-gboolean nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses);
|
||||
+gboolean nm_platform_ip6_address_sync (int ifindex, const GArray *known_addresses, gboolean keep_link_local);
|
||||
gboolean nm_platform_address_flush (int ifindex);
|
||||
|
||||
gboolean nm_platform_ip4_check_reinstall_device_route (int ifindex, const NMPlatformIP4Address *address, guint32 device_route_metric);
|
||||
--
|
||||
2.1.0
|
||||
|
@ -1,43 +0,0 @@
|
||||
From a687d1f9e0f75b987f40335934b54aa748f6724b Mon Sep 17 00:00:00 2001
|
||||
From: Dan Williams <dcbw@redhat.com>
|
||||
Date: Fri, 9 Jan 2015 15:47:54 -0600
|
||||
Subject: core: ensure manager state is updated on resume with connectivity
|
||||
checking enabled (rh #1162636) (bgo #742675)
|
||||
|
||||
On resume configured interfaces are unmanaged to clear their pre-resume
|
||||
state and then re-managed. Eventually the interface should end up moving
|
||||
to the DISCONNECTED state, which should trigger an auto-activate check in
|
||||
the Policy. If connectivity checking was enabled, that auto-activate check
|
||||
would fail because the Manager's state was still NM_STATE_ASLEEP.
|
||||
|
||||
This caused bridge slaves not to auto-activate on resume, which left bridges
|
||||
without connectivity.
|
||||
|
||||
The manager never left NM_STATE_ASLEEP when connectivity checking was
|
||||
enabled due to nm_manager_update_state() returning early when kicking
|
||||
off a connectivity check. Instead, the manager's state should always
|
||||
be updated to accurately reflect the current state.
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1162636
|
||||
https://bugzilla.gnome.org/show_bug.cgi?id=742675
|
||||
|
||||
diff --git a/src/nm-manager.c b/src/nm-manager.c
|
||||
index f3c5081..3d7b80d 100644
|
||||
--- a/src/nm-manager.c
|
||||
+++ b/src/nm-manager.c
|
||||
@@ -645,10 +645,9 @@ nm_manager_update_state (NMManager *manager)
|
||||
nm_connectivity_check_async (priv->connectivity,
|
||||
checked_connectivity,
|
||||
g_object_ref (manager));
|
||||
- return;
|
||||
- }
|
||||
+ } else
|
||||
+ nm_connectivity_set_online (priv->connectivity, new_state >= NM_STATE_CONNECTED_LOCAL);
|
||||
|
||||
- nm_connectivity_set_online (priv->connectivity, new_state >= NM_STATE_CONNECTED_LOCAL);
|
||||
set_state (manager, new_state);
|
||||
}
|
||||
|
||||
--
|
||||
cgit v0.10.2
|
||||
|
@ -9,8 +9,8 @@
|
||||
|
||||
%define snapshot %{nil}
|
||||
%define git_sha %{nil}
|
||||
%define realversion 1.0.0
|
||||
%define release_version 9
|
||||
%define realversion 1.0.2
|
||||
%define release_version 1
|
||||
%define epoch_version 1
|
||||
|
||||
%define obsoletes_nmver 1:0.9.9.95-1
|
||||
@ -79,15 +79,6 @@ Source3: 20-connectivity-fedora.conf
|
||||
# Not upstream.
|
||||
Patch0: 0000-explain-dns1-dns2.patch
|
||||
|
||||
# http://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=a687d1f9e0f75b987f40335934b54aa748f6724b
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1162636
|
||||
Patch2: NetworkManager-1.0.0-bridge_resume.patch
|
||||
|
||||
Patch3: 0001-ip6-config-remove-the-link-local-address-on-address-.patch
|
||||
Patch4: bgo742823-connectivity-no-dns.patch
|
||||
Patch5: 0001-connectivity-disable-HTTP-keepalive-for-connectivity.patch
|
||||
Patch6: rh1212118-detect-CTC-devices.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
%if 0%{?fedora} && 0%{?fedora} < 20
|
||||
@ -370,11 +361,6 @@ by nm-connection-editor and nm-applet in a non-graphical environment.
|
||||
%setup -q -n NetworkManager-%{realversion}
|
||||
|
||||
%patch0 -p1 -b .0000-explain-dns1-dns2.orig
|
||||
%patch2 -p1 -b .bridge_resume
|
||||
%patch3 -p1 -b .v6ll-flush
|
||||
%patch4 -p1 -b .bgo742823-connectivity-no-dns.orig
|
||||
%patch5 -p1 -b .0001-connectivity-disable-HTTP-keepalive-for-connectivity.orig
|
||||
%patch6 -p1 -b .rh1212118-detect-CTC-devices.orig
|
||||
|
||||
%build
|
||||
|
||||
@ -667,6 +653,9 @@ fi
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Tue May 5 2015 Lubomir Rintel <lkundrak@v3.sk> - 1:1.0.2-1
|
||||
- Update to 1.0.2 release
|
||||
|
||||
* Wed Apr 29 2015 Jiří Klimeš <jklimes@redhat.com> - 1:1.0.0-9
|
||||
- platform: use driver name to detect IBM z-System CTC devices (rh #1212118)
|
||||
|
||||
|
@ -1,348 +0,0 @@
|
||||
From 0a22ce64a6a8c2ec0f8a71f1a59855593cdeb96a Mon Sep 17 00:00:00 2001
|
||||
From: Dan Winship <danw@redhat.com>
|
||||
Date: Tue, 13 Jan 2015 15:08:21 -0500
|
||||
Subject: [PATCH 1/4] connectivity: improve debug logging
|
||||
|
||||
nm-connectivity was logging both "started" and "finished" for periodic
|
||||
connectivity checks, but was only logging "finished" for manual ones,
|
||||
which made the logs look weird. Fix it to log both periodic and manual
|
||||
starts, and differentiate them.
|
||||
|
||||
Also add some additional logging to indicate when set_online() is
|
||||
called, and when :state changes.
|
||||
|
||||
(cherry picked from commit 53f2642c736ebb8466cbfd29c2ede2c3828a4728)
|
||||
---
|
||||
src/nm-connectivity.c | 31 ++++++++++++++++++++++++++++++-
|
||||
1 file changed, 30 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/nm-connectivity.c b/src/nm-connectivity.c
|
||||
index 8a324a5..5913fd9 100644
|
||||
--- a/src/nm-connectivity.c
|
||||
+++ b/src/nm-connectivity.c
|
||||
@@ -69,12 +69,33 @@ nm_connectivity_get_state (NMConnectivity *connectivity)
|
||||
return NM_CONNECTIVITY_GET_PRIVATE (connectivity)->state;
|
||||
}
|
||||
|
||||
+static const char *
|
||||
+state_name (NMConnectivityState state)
|
||||
+{
|
||||
+ switch (state) {
|
||||
+ case NM_CONNECTIVITY_UNKNOWN:
|
||||
+ return "UNKNOWN";
|
||||
+ case NM_CONNECTIVITY_NONE:
|
||||
+ return "NONE";
|
||||
+ case NM_CONNECTIVITY_LIMITED:
|
||||
+ return "LIMITED";
|
||||
+ case NM_CONNECTIVITY_PORTAL:
|
||||
+ return "PORTAL";
|
||||
+ case NM_CONNECTIVITY_FULL:
|
||||
+ return "FULL";
|
||||
+ default:
|
||||
+ return "???";
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static void
|
||||
update_state (NMConnectivity *self, NMConnectivityState state)
|
||||
{
|
||||
NMConnectivityPrivate *priv = NM_CONNECTIVITY_GET_PRIVATE (self);
|
||||
|
||||
if (priv->state != state) {
|
||||
+ nm_log_dbg (LOGD_CONCHECK, "Connectivity state changed from %s to %s",
|
||||
+ state_name (priv->state), state_name (state));
|
||||
priv->state = state;
|
||||
g_object_notify (G_OBJECT (self), NM_CONNECTIVITY_STATE);
|
||||
}
|
||||
@@ -155,7 +176,6 @@ run_check (gpointer user_data)
|
||||
|
||||
nm_connectivity_check_async (self, run_check_complete, NULL);
|
||||
priv->running = TRUE;
|
||||
- nm_log_dbg (LOGD_CONCHECK, "Connectivity check with uri '%s' started.", priv->uri);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -167,7 +187,11 @@ nm_connectivity_set_online (NMConnectivity *self,
|
||||
{
|
||||
#if WITH_CONCHECK
|
||||
NMConnectivityPrivate *priv = NM_CONNECTIVITY_GET_PRIVATE (self);
|
||||
+#endif
|
||||
|
||||
+ nm_log_dbg (LOGD_CONCHECK, "nm_connectivity_set_online(%s)", online ? "TRUE" : "FALSE");
|
||||
+
|
||||
+#if WITH_CONCHECK
|
||||
if (online && priv->uri && priv->interval) {
|
||||
if (!priv->check_id)
|
||||
priv->check_id = g_timeout_add_seconds (priv->interval, run_check, self);
|
||||
@@ -201,6 +225,11 @@ nm_connectivity_check_async (NMConnectivity *self,
|
||||
g_return_if_fail (NM_IS_CONNECTIVITY (self));
|
||||
priv = NM_CONNECTIVITY_GET_PRIVATE (self);
|
||||
|
||||
+ if (callback == run_check_complete)
|
||||
+ nm_log_dbg (LOGD_CONCHECK, "Periodic connectivity check started with uri '%s'.", priv->uri);
|
||||
+ else
|
||||
+ nm_log_dbg (LOGD_CONCHECK, "Connectivity check started with uri '%s'.", priv->uri);
|
||||
+
|
||||
simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data,
|
||||
nm_connectivity_check_async);
|
||||
|
||||
--
|
||||
2.1.0
|
||||
|
||||
From e042bb09a56511ffc6040f8e125863ebb5623974 Mon Sep 17 00:00:00 2001
|
||||
From: Dan Winship <danw@redhat.com>
|
||||
Date: Tue, 13 Jan 2015 14:48:29 -0500
|
||||
Subject: [PATCH 2/4] connectivity: fix manager state during connectivity check
|
||||
(bgo #742823)
|
||||
|
||||
When a connection has finished activating, but we don't know yet that
|
||||
we have full connectivity, then find_best_device_state() should return
|
||||
CONNECTED_SITE, not CONNECTING. Fixes a bug where the manager state
|
||||
would repeatedly switch between those two states.
|
||||
|
||||
(cherry picked from commit 5e182d55777b95886d39068821d1d6fa8298474d)
|
||||
---
|
||||
src/nm-manager.c | 14 +++++---------
|
||||
1 file changed, 5 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/nm-manager.c b/src/nm-manager.c
|
||||
index 65fb568..fb4e016 100644
|
||||
--- a/src/nm-manager.c
|
||||
+++ b/src/nm-manager.c
|
||||
@@ -578,7 +578,7 @@ checked_connectivity (GObject *object, GAsyncResult *result, gpointer user_data)
|
||||
}
|
||||
|
||||
static NMState
|
||||
-find_best_device_state (NMManager *manager, gboolean *want_connectivity_check)
|
||||
+find_best_device_state (NMManager *manager)
|
||||
{
|
||||
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager);
|
||||
NMState best_state = NM_STATE_DISCONNECTED;
|
||||
@@ -593,13 +593,10 @@ find_best_device_state (NMManager *manager, gboolean *want_connectivity_check)
|
||||
if ( nm_active_connection_get_default (ac)
|
||||
|| nm_active_connection_get_default6 (ac)) {
|
||||
nm_connectivity_set_online (priv->connectivity, TRUE);
|
||||
- if (nm_connectivity_get_state (priv->connectivity) == NM_CONNECTIVITY_FULL) {
|
||||
- *want_connectivity_check = FALSE;
|
||||
+ if (nm_connectivity_get_state (priv->connectivity) == NM_CONNECTIVITY_FULL)
|
||||
return NM_STATE_CONNECTED_GLOBAL;
|
||||
- }
|
||||
|
||||
- best_state = NM_STATE_CONNECTING;
|
||||
- *want_connectivity_check = TRUE;
|
||||
+ best_state = NM_STATE_CONNECTED_SITE;
|
||||
} else {
|
||||
if (best_state < NM_STATE_CONNECTING)
|
||||
best_state = NM_STATE_CONNECTED_LOCAL;
|
||||
@@ -630,7 +627,6 @@ nm_manager_update_state (NMManager *manager)
|
||||
{
|
||||
NMManagerPrivate *priv;
|
||||
NMState new_state = NM_STATE_DISCONNECTED;
|
||||
- gboolean want_connectivity_check = FALSE;
|
||||
|
||||
g_return_if_fail (NM_IS_MANAGER (manager));
|
||||
|
||||
@@ -639,9 +635,9 @@ nm_manager_update_state (NMManager *manager)
|
||||
if (manager_sleeping (manager))
|
||||
new_state = NM_STATE_ASLEEP;
|
||||
else
|
||||
- new_state = find_best_device_state (manager, &want_connectivity_check);
|
||||
+ new_state = find_best_device_state (manager);
|
||||
|
||||
- if (new_state == NM_STATE_CONNECTING && want_connectivity_check) {
|
||||
+ if (new_state == NM_STATE_CONNECTED_SITE) {
|
||||
nm_connectivity_check_async (priv->connectivity,
|
||||
checked_connectivity,
|
||||
g_object_ref (manager));
|
||||
--
|
||||
2.1.0
|
||||
|
||||
From 57249a2d0513a51e7446b7058f9e24e69cabbf6c Mon Sep 17 00:00:00 2001
|
||||
From: Dan Winship <danw@redhat.com>
|
||||
Date: Tue, 13 Jan 2015 15:35:10 -0500
|
||||
Subject: [PATCH 3/4] connectivity: simplify redundant code
|
||||
|
||||
Merge the two nm_connectivity_set_online() calls into one, after
|
||||
tweaking NMConnectivity to always update its internal state before
|
||||
alerting callers to the new state.
|
||||
|
||||
(cherry picked from commit 0997c4b245ca5638d0d27eee90146dc47c56130d)
|
||||
---
|
||||
src/nm-connectivity.c | 4 ++--
|
||||
src/nm-manager.c | 6 +++---
|
||||
2 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/nm-connectivity.c b/src/nm-connectivity.c
|
||||
index 5913fd9..cf4552a 100644
|
||||
--- a/src/nm-connectivity.c
|
||||
+++ b/src/nm-connectivity.c
|
||||
@@ -145,10 +145,10 @@ nm_connectivity_check_cb (SoupSession *session, SoupMessage *msg, gpointer user_
|
||||
}
|
||||
|
||||
done:
|
||||
+ update_state (self, new_state);
|
||||
+
|
||||
g_simple_async_result_set_op_res_gssize (simple, new_state);
|
||||
g_simple_async_result_complete (simple);
|
||||
-
|
||||
- update_state (self, new_state);
|
||||
}
|
||||
|
||||
static void
|
||||
diff --git a/src/nm-manager.c b/src/nm-manager.c
|
||||
index fb4e016..62a1e15 100644
|
||||
--- a/src/nm-manager.c
|
||||
+++ b/src/nm-manager.c
|
||||
@@ -592,7 +592,6 @@ find_best_device_state (NMManager *manager)
|
||||
case NM_ACTIVE_CONNECTION_STATE_ACTIVATED:
|
||||
if ( nm_active_connection_get_default (ac)
|
||||
|| nm_active_connection_get_default6 (ac)) {
|
||||
- nm_connectivity_set_online (priv->connectivity, TRUE);
|
||||
if (nm_connectivity_get_state (priv->connectivity) == NM_CONNECTIVITY_FULL)
|
||||
return NM_STATE_CONNECTED_GLOBAL;
|
||||
|
||||
@@ -637,12 +636,13 @@ nm_manager_update_state (NMManager *manager)
|
||||
else
|
||||
new_state = find_best_device_state (manager);
|
||||
|
||||
+ nm_connectivity_set_online (priv->connectivity, new_state >= NM_STATE_CONNECTED_LOCAL);
|
||||
+
|
||||
if (new_state == NM_STATE_CONNECTED_SITE) {
|
||||
nm_connectivity_check_async (priv->connectivity,
|
||||
checked_connectivity,
|
||||
g_object_ref (manager));
|
||||
- } else
|
||||
- nm_connectivity_set_online (priv->connectivity, new_state >= NM_STATE_CONNECTED_LOCAL);
|
||||
+ }
|
||||
|
||||
set_state (manager, new_state);
|
||||
}
|
||||
--
|
||||
2.1.0
|
||||
|
||||
From 3d49585b377a578ce0195d74c5b5125a1101c688 Mon Sep 17 00:00:00 2001
|
||||
From: Dan Winship <danw@redhat.com>
|
||||
Date: Tue, 13 Jan 2015 15:25:31 -0500
|
||||
Subject: [PATCH 4/4] connectivity: avoid redundant connectivity checks
|
||||
|
||||
Don't start an automatic connectivity check right when NMManager tells
|
||||
us we're online; only do it if the manager doesn't request an explicit
|
||||
connectivity check immediately afterward.
|
||||
|
||||
(cherry picked from commit 66b8f2b7a0f9e1ce84d8a98863c88ea3dbed0a51)
|
||||
---
|
||||
src/nm-connectivity.c | 26 +++++++++++++++++---------
|
||||
1 file changed, 17 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/nm-connectivity.c b/src/nm-connectivity.c
|
||||
index cf4552a..1a374eb 100644
|
||||
--- a/src/nm-connectivity.c
|
||||
+++ b/src/nm-connectivity.c
|
||||
@@ -44,7 +44,7 @@ typedef struct {
|
||||
|
||||
#if WITH_CONCHECK
|
||||
SoupSession *soup_session;
|
||||
- gboolean running;
|
||||
+ guint pending_checks;
|
||||
guint check_id;
|
||||
#endif
|
||||
|
||||
@@ -114,6 +114,7 @@ nm_connectivity_check_cb (SoupSession *session, SoupMessage *msg, gpointer user_
|
||||
self = NM_CONNECTIVITY (g_async_result_get_source_object (G_ASYNC_RESULT (simple)));
|
||||
g_object_unref (self);
|
||||
priv = NM_CONNECTIVITY_GET_PRIVATE (self);
|
||||
+ priv->pending_checks--;
|
||||
|
||||
if (SOUP_STATUS_IS_TRANSPORT_ERROR (msg->status_code)) {
|
||||
nm_log_info (LOGD_CONCHECK, "Connectivity check for uri '%s' failed with '%s'.",
|
||||
@@ -157,11 +158,9 @@ run_check_complete (GObject *object,
|
||||
gpointer user_data)
|
||||
{
|
||||
NMConnectivity *self = NM_CONNECTIVITY (object);
|
||||
- NMConnectivityPrivate *priv = NM_CONNECTIVITY_GET_PRIVATE (self);
|
||||
GError *error = NULL;
|
||||
|
||||
nm_connectivity_check_finish (self, result, &error);
|
||||
- priv->running = FALSE;
|
||||
if (error) {
|
||||
nm_log_err (LOGD_CONCHECK, "Connectivity check failed: %s", error->message);
|
||||
g_error_free (error);
|
||||
@@ -172,13 +171,23 @@ static gboolean
|
||||
run_check (gpointer user_data)
|
||||
{
|
||||
NMConnectivity *self = NM_CONNECTIVITY (user_data);
|
||||
- NMConnectivityPrivate *priv = NM_CONNECTIVITY_GET_PRIVATE (self);
|
||||
|
||||
nm_connectivity_check_async (self, run_check_complete, NULL);
|
||||
- priv->running = TRUE;
|
||||
-
|
||||
return TRUE;
|
||||
}
|
||||
+
|
||||
+static gboolean
|
||||
+idle_start_periodic_checks (gpointer user_data)
|
||||
+{
|
||||
+ NMConnectivity *self = user_data;
|
||||
+ NMConnectivityPrivate *priv = NM_CONNECTIVITY_GET_PRIVATE (self);
|
||||
+
|
||||
+ priv->check_id = g_timeout_add_seconds (priv->interval, run_check, self);
|
||||
+ if (!priv->pending_checks)
|
||||
+ run_check (self);
|
||||
+
|
||||
+ return FALSE;
|
||||
+}
|
||||
#endif
|
||||
|
||||
void
|
||||
@@ -194,9 +203,7 @@ nm_connectivity_set_online (NMConnectivity *self,
|
||||
#if WITH_CONCHECK
|
||||
if (online && priv->uri && priv->interval) {
|
||||
if (!priv->check_id)
|
||||
- priv->check_id = g_timeout_add_seconds (priv->interval, run_check, self);
|
||||
- if (!priv->running)
|
||||
- run_check (self);
|
||||
+ priv->check_id = g_timeout_add (0, idle_start_periodic_checks, self);
|
||||
|
||||
return;
|
||||
} else if (priv->check_id) {
|
||||
@@ -241,6 +248,7 @@ nm_connectivity_check_async (NMConnectivity *self,
|
||||
msg,
|
||||
nm_connectivity_check_cb,
|
||||
simple);
|
||||
+ priv->pending_checks++;
|
||||
|
||||
return;
|
||||
}
|
||||
--
|
||||
2.1.0
|
||||
|
||||
From ecd7227d45fc517230073d48a68a51937b60daea Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Haller <thaller@redhat.com>
|
||||
Date: Fri, 16 Jan 2015 14:15:24 +0100
|
||||
Subject: [PATCH] connectivity: fix compile error no WITH_CONCHECK
|
||||
|
||||
Fixes: 53f2642c736ebb8466cbfd29c2ede2c3828a4728
|
||||
(cherry picked from commit 07be0f511d6d559431ea66bdf74b00e4c276904b)
|
||||
---
|
||||
src/nm-connectivity.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/nm-connectivity.c b/src/nm-connectivity.c
|
||||
index 1a374eb..f35da5e 100644
|
||||
--- a/src/nm-connectivity.c
|
||||
+++ b/src/nm-connectivity.c
|
||||
@@ -232,9 +232,11 @@ nm_connectivity_check_async (NMConnectivity *self,
|
||||
g_return_if_fail (NM_IS_CONNECTIVITY (self));
|
||||
priv = NM_CONNECTIVITY_GET_PRIVATE (self);
|
||||
|
||||
+#if WITH_CONCHECK
|
||||
if (callback == run_check_complete)
|
||||
nm_log_dbg (LOGD_CONCHECK, "Periodic connectivity check started with uri '%s'.", priv->uri);
|
||||
else
|
||||
+#endif
|
||||
nm_log_dbg (LOGD_CONCHECK, "Connectivity check started with uri '%s'.", priv->uri);
|
||||
|
||||
simple = g_simple_async_result_new (G_OBJECT (self), callback, user_data,
|
||||
--
|
||||
2.1.0
|
||||
|
@ -1,48 +0,0 @@
|
||||
From 02c6a9334335d3ef32c6cc8fafc6cea235c80ffc Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
|
||||
Date: Mon, 20 Apr 2015 14:14:36 +0200
|
||||
Subject: [PATCH] platform: use driver name to detect IBM z-System CTC devices
|
||||
(rh #1212118)
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
We used to detect CTC devices according to the interface name. But that does
|
||||
not work anymore due to systemd renaming the devices.
|
||||
Let's use driver name for the detection instead. The driver is called 'ctcm'.
|
||||
|
||||
http://www-01.ibm.com/support/knowledgecenter/linuxonibm/com.ibm.linux.z.lgdd/lgdd_r_mpc_setup.html
|
||||
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1212118
|
||||
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
|
||||
---
|
||||
src/platform/nm-linux-platform.c | 7 +++----
|
||||
1 file changed, 3 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
|
||||
index d831bd3..ed22fe2 100644
|
||||
--- a/src/platform/nm-linux-platform.c
|
||||
+++ b/src/platform/nm-linux-platform.c
|
||||
@@ -954,16 +954,15 @@ link_extract_type (NMPlatform *platform, struct rtnl_link *rtnllink, const char
|
||||
if (!ifname)
|
||||
return_type (NM_LINK_TYPE_UNKNOWN, type);
|
||||
|
||||
+ driver = ethtool_get_driver (ifname);
|
||||
if (arptype == 256) {
|
||||
/* Some s390 CTC-type devices report 256 for the encapsulation type
|
||||
- * for some reason, but we need to call them Ethernet. FIXME: use
|
||||
- * something other than interface name to detect CTC here.
|
||||
+ * for some reason, but we need to call them Ethernet.
|
||||
*/
|
||||
- if (g_str_has_prefix (ifname, "ctc"))
|
||||
+ if (!g_strcmp0 (driver, "ctcm"))
|
||||
return_type (NM_LINK_TYPE_ETHERNET, "ethernet");
|
||||
}
|
||||
|
||||
- driver = ethtool_get_driver (ifname);
|
||||
if (!g_strcmp0 (driver, "openvswitch"))
|
||||
return_type (NM_LINK_TYPE_OPENVSWITCH, "openvswitch");
|
||||
|
||||
--
|
||||
2.1.0
|
||||
|
Loading…
Reference in New Issue
Block a user