Update to 1.0

This commit is contained in:
Dan Williams 2014-12-22 10:47:26 -06:00
parent 8b454ba75e
commit f249abd921
12 changed files with 120 additions and 1567 deletions

1
.gitignore vendored
View File

@ -308,3 +308,4 @@ network-manager-applet-0.8.1.tar.bz2
/NetworkManager-0.9.9.95.git20140609.1963adda.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

View File

@ -1,26 +0,0 @@
From 2a10b58fad810aca1a041cd37b00241ace9be0c7 Mon Sep 17 00:00:00 2001
From: Marius Vollmer <mvollmer@redhat.com>
Date: Mon, 13 Oct 2014 15:58:46 -0500
Subject: [PATCH 1/4] policy: allow non-local admin sessions to control the
network (rh #1145646)
(cherry picked from commit 4f950ee5692e57bbc9737720adfd7ad6788dabb7)
---
policy/org.freedesktop.NetworkManager.policy.in.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/policy/org.freedesktop.NetworkManager.policy.in.in b/policy/org.freedesktop.NetworkManager.policy.in.in
index cb22999..daefd80 100644
--- a/policy/org.freedesktop.NetworkManager.policy.in.in
+++ b/policy/org.freedesktop.NetworkManager.policy.in.in
@@ -58,6 +58,7 @@
<_description>Allow control of network connections</_description>
<_message>System policy prevents control of network connections</_message>
<defaults>
+ <allow_any>auth_admin</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
--
1.9.3

View File

@ -1,171 +0,0 @@
From 616d032c62f0d02be7ec29ff012c45c284f397a8 Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Mon, 16 Jun 2014 11:04:06 -0500
Subject: [PATCH 2/4] bluez: split out errors
We'll use them from more places than nm nm-bt-device.c in the future.
(cherry picked from commit 5254ac456ecd2f5ef76b0a1937f52b75e319f204)
---
src/devices/bluetooth/Makefile.am | 4 +++-
src/devices/bluetooth/nm-bt-error.c | 33 +++++++++++++++++++++++++++++++++
src/devices/bluetooth/nm-bt-error.h | 35 +++++++++++++++++++++++++++++++++++
src/devices/bluetooth/nm-device-bt.c | 13 ++-----------
src/devices/bluetooth/nm-device-bt.h | 6 ------
5 files changed, 73 insertions(+), 18 deletions(-)
create mode 100644 src/devices/bluetooth/nm-bt-error.c
create mode 100644 src/devices/bluetooth/nm-bt-error.h
diff --git a/src/devices/bluetooth/Makefile.am b/src/devices/bluetooth/Makefile.am
index 639a1ad..4342d4b 100644
--- a/src/devices/bluetooth/Makefile.am
+++ b/src/devices/bluetooth/Makefile.am
@@ -24,7 +24,7 @@ AM_CPPFLAGS = \
GLIB_GENERATED = nm-bt-enum-types.h nm-bt-enum-types.c
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM
-nm_bt_enum_types_sources = $(srcdir)/nm-device-bt.h
+nm_bt_enum_types_sources = $(srcdir)/nm-bt-error.h
nm-device-bt-glue.h: $(top_srcdir)/introspection/nm-device-bt.xml
dbus-binding-tool --prefix=nm_device_bt --mode=glib-server --output=$@ $<
@@ -47,6 +47,8 @@ libnm_device_plugin_bluetooth_la_SOURCES = \
nm-bluez4-manager.h \
nm-bluez5-manager.c \
nm-bluez5-manager.h \
+ nm-bt-error.h \
+ nm-bt-error.c \
\
nm-device-bt.c \
nm-device-bt.h \
diff --git a/src/devices/bluetooth/nm-bt-error.c b/src/devices/bluetooth/nm-bt-error.c
new file mode 100644
index 0000000..d014a10
--- /dev/null
+++ b/src/devices/bluetooth/nm-bt-error.c
@@ -0,0 +1,33 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager -- Network link manager
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Copyright (C) 2014 Red Hat, Inc.
+ */
+
+#include <glib.h>
+#include "nm-bt-error.h"
+
+GQuark
+nm_bt_error_quark (void)
+{
+ static GQuark quark = 0;
+ if (!quark)
+ quark = g_quark_from_static_string ("nm-bt-error");
+ return quark;
+}
+
+
diff --git a/src/devices/bluetooth/nm-bt-error.h b/src/devices/bluetooth/nm-bt-error.h
new file mode 100644
index 0000000..fa3a957
--- /dev/null
+++ b/src/devices/bluetooth/nm-bt-error.h
@@ -0,0 +1,35 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager -- Network link manager
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Copyright (C) 2014 Red Hat, Inc.
+ */
+
+#ifndef _NM_BLUEZ5_ERROR_H_
+#define _NM_BLUEZ5_ERROR_H_
+
+typedef enum {
+ NM_BT_ERROR_CONNECTION_NOT_BT = 0, /*< nick=ConnectionNotBt >*/
+ NM_BT_ERROR_CONNECTION_INVALID, /*< nick=ConnectionInvalid >*/
+ NM_BT_ERROR_CONNECTION_INCOMPATIBLE, /*< nick=ConnectionIncompatible >*/
+ NM_BT_ERROR_DUN_CONNECT_FAILED, /*< nick=DunConnectFailed >*/
+} NMBtError;
+
+#define NM_BT_ERROR (nm_bt_error_quark ())
+GQuark nm_bt_error_quark (void);
+
+#endif /* _NM_BT_ERROR_H_ */
+
diff --git a/src/devices/bluetooth/nm-device-bt.c b/src/devices/bluetooth/nm-device-bt.c
index 6e1a399..ca3deb2 100644
--- a/src/devices/bluetooth/nm-device-bt.c
+++ b/src/devices/bluetooth/nm-device-bt.c
@@ -46,6 +46,8 @@
#include "NetworkManagerUtils.h"
#include "nm-bt-enum-types.h"
#include "nm-utils.h"
+#include "nm-bt-error.h"
+#include "nm-bt-enum-types.h"
#define MM_OLD_DBUS_SERVICE "org.freedesktop.ModemManager"
#define MM_NEW_DBUS_SERVICE "org.freedesktop.ModemManager1"
@@ -94,17 +96,6 @@ enum {
static guint signals[LAST_SIGNAL] = { 0 };
-#define NM_BT_ERROR (nm_bt_error_quark ())
-
-static GQuark
-nm_bt_error_quark (void)
-{
- static GQuark quark = 0;
- if (!quark)
- quark = g_quark_from_static_string ("nm-bt-error");
- return quark;
-}
-
guint32 nm_device_bt_get_capabilities (NMDeviceBt *self)
{
g_return_val_if_fail (NM_IS_DEVICE_BT (self), NM_BT_CAPABILITY_NONE);
diff --git a/src/devices/bluetooth/nm-device-bt.h b/src/devices/bluetooth/nm-device-bt.h
index 83732bc..ac5b115 100644
--- a/src/devices/bluetooth/nm-device-bt.h
+++ b/src/devices/bluetooth/nm-device-bt.h
@@ -34,12 +34,6 @@ G_BEGIN_DECLS
#define NM_IS_DEVICE_BT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_DEVICE_BT))
#define NM_DEVICE_BT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_DEVICE_BT, NMDeviceBtClass))
-typedef enum {
- NM_BT_ERROR_CONNECTION_NOT_BT = 0, /*< nick=ConnectionNotBt >*/
- NM_BT_ERROR_CONNECTION_INVALID, /*< nick=ConnectionInvalid >*/
- NM_BT_ERROR_CONNECTION_INCOMPATIBLE, /*< nick=ConnectionIncompatible >*/
-} NMBtError;
-
#define NM_DEVICE_BT_NAME "name"
#define NM_DEVICE_BT_CAPABILITIES "bt-capabilities"
#define NM_DEVICE_BT_DEVICE "bt-device"
--
1.9.3

View File

@ -1,147 +0,0 @@
From d59bd3c9b57e55b20fd4d2e4781a8da123546f4d Mon Sep 17 00:00:00 2001
From: Dan Williams <dcbw@redhat.com>
Date: Mon, 16 Jun 2014 10:20:29 -0500
Subject: [PATCH 3/4] bluez: track adapter address in NMBluezDevice
We'll need it for bluez5 DUN support.
[lkundrak@v3.sk: Turn the addresses to strings from guint8[ETH_ALEN], as that
is what rest of NetworkManager uses for MAC addresses and what Bluez utility
functions expect as well.]
(cherry picked from commit 384ec8606488e67433753eb52440b4846a3090e7)
---
src/devices/bluetooth/nm-bluez-device.c | 29 ++++++++++++++++++++++++++---
src/devices/bluetooth/nm-bluez-device.h | 5 ++++-
src/devices/bluetooth/nm-bluez4-adapter.c | 2 +-
src/devices/bluetooth/nm-bluez5-manager.c | 2 +-
4 files changed, 32 insertions(+), 6 deletions(-)
diff --git a/src/devices/bluetooth/nm-bluez-device.c b/src/devices/bluetooth/nm-bluez-device.c
index 4c448a3..edebb75 100644
--- a/src/devices/bluetooth/nm-bluez-device.c
+++ b/src/devices/bluetooth/nm-bluez-device.c
@@ -55,6 +55,7 @@ typedef struct {
gboolean usable;
NMBluetoothCapabilities connection_bt_type;
+ char *adapter_address;
char *address;
guint8 bin_address[ETH_ALEN];
char *name;
@@ -270,7 +271,7 @@ check_emit_usable (NMBluezDevice *self)
new_usable = (priv->initialized && priv->capabilities && priv->name &&
((priv->bluez_version == 4) ||
(priv->bluez_version == 5 && priv->adapter5 && priv->adapter_powered) ) &&
- priv->dbus_connection && priv->address);
+ priv->dbus_connection && priv->address && priv->adapter_address);
if (!new_usable)
goto END;
@@ -558,6 +559,18 @@ nm_bluez_device_connect_finish (NMBluezDevice *self,
/***********************************************************/
+static void
+set_adapter_address (NMBluezDevice *self, const char *address)
+{
+ NMBluezDevicePrivate *priv = NM_BLUEZ_DEVICE_GET_PRIVATE (self);
+
+ g_return_if_fail (address);
+
+ if (priv->adapter_address)
+ g_free (priv->adapter_address);
+ priv->adapter_address = g_strdup (address);
+}
+
static guint32
convert_uuids_to_capabilities (const char **strings, int bluez_version)
{
@@ -752,6 +765,10 @@ adapter5_on_acquired (GObject *object, GAsyncResult *res, NMBluezDevice *self)
if (v)
g_variant_unref (v);
+ v = g_dbus_proxy_get_cached_property (priv->adapter5, "Address");
+ if (VARIANT_IS_OF_TYPE_STRING (v))
+ set_adapter_address (self, g_variant_get_string (v, NULL));
+
priv->initialized = TRUE;
g_signal_emit (self, signals[INITIALIZED], 0, TRUE);
@@ -957,7 +974,10 @@ on_bus_acquired (GObject *object, GAsyncResult *res, NMBluezDevice *self)
/********************************************************************/
NMBluezDevice *
-nm_bluez_device_new (const char *path, NMConnectionProvider *provider, int bluez_version)
+nm_bluez_device_new (const char *path,
+ const char *adapter_address,
+ NMConnectionProvider *provider,
+ int bluez_version)
{
NMBluezDevice *self;
NMBluezDevicePrivate *priv;
@@ -978,8 +998,10 @@ nm_bluez_device_new (const char *path, NMConnectionProvider *provider, int bluez
priv = NM_BLUEZ_DEVICE_GET_PRIVATE (self);
priv->bluez_version = bluez_version;
-
priv->provider = provider;
+ g_return_val_if_fail (bluez_version == 5 || (bluez_version == 4 && adapter_address), NULL);
+ if (adapter_address)
+ set_adapter_address (self, adapter_address);
g_signal_connect (priv->provider,
NM_CP_SIGNAL_CONNECTION_ADDED,
@@ -1073,6 +1095,7 @@ finalize (GObject *object)
nm_log_dbg (LOGD_BT, "bluez[%s]: finalize NMBluezDevice", priv->path);
g_free (priv->path);
+ g_free (priv->adapter_address);
g_free (priv->address);
g_free (priv->name);
g_free (priv->bt_iface);
diff --git a/src/devices/bluetooth/nm-bluez-device.h b/src/devices/bluetooth/nm-bluez-device.h
index 0bf7d89..25891a0 100644
--- a/src/devices/bluetooth/nm-bluez-device.h
+++ b/src/devices/bluetooth/nm-bluez-device.h
@@ -62,7 +62,10 @@ typedef struct {
GType nm_bluez_device_get_type (void);
-NMBluezDevice *nm_bluez_device_new (const char *path, NMConnectionProvider *provider, int bluez_version);
+NMBluezDevice *nm_bluez_device_new (const char *path,
+ const char *adapter_address,
+ NMConnectionProvider *provider,
+ int bluez_version);
const char *nm_bluez_device_get_path (NMBluezDevice *self);
diff --git a/src/devices/bluetooth/nm-bluez4-adapter.c b/src/devices/bluetooth/nm-bluez4-adapter.c
index ad1786f..9c57d97 100644
--- a/src/devices/bluetooth/nm-bluez4-adapter.c
+++ b/src/devices/bluetooth/nm-bluez4-adapter.c
@@ -162,7 +162,7 @@ device_created (DBusGProxy *proxy, const char *path, gpointer user_data)
NMBluez4AdapterPrivate *priv = NM_BLUEZ4_ADAPTER_GET_PRIVATE (self);
NMBluezDevice *device;
- device = nm_bluez_device_new (path, priv->provider, 4);
+ device = nm_bluez_device_new (path, priv->address, priv->provider, 4);
g_signal_connect (device, "initialized", G_CALLBACK (device_initialized), self);
g_signal_connect (device, "notify::usable", G_CALLBACK (device_usable), self);
g_hash_table_insert (priv->devices, (gpointer) nm_bluez_device_get_path (device), device);
diff --git a/src/devices/bluetooth/nm-bluez5-manager.c b/src/devices/bluetooth/nm-bluez5-manager.c
index 63006b3..8653c28 100644
--- a/src/devices/bluetooth/nm-bluez5-manager.c
+++ b/src/devices/bluetooth/nm-bluez5-manager.c
@@ -143,7 +143,7 @@ device_added (GDBusProxy *proxy, const gchar *path, NMBluez5Manager *self)
NMBluez5ManagerPrivate *priv = NM_BLUEZ5_MANAGER_GET_PRIVATE (self);
NMBluezDevice *device;
- device = nm_bluez_device_new (path, priv->provider, 5);
+ device = nm_bluez_device_new (path, NULL, priv->provider, 5);
g_signal_connect (device, "initialized", G_CALLBACK (device_initialized), self);
g_signal_connect (device, "notify::usable", G_CALLBACK (device_usable), self);
g_hash_table_insert (priv->devices, (gpointer) nm_bluez_device_get_path (device), device);
--
1.9.3

View File

@ -1,810 +0,0 @@
From 2ca59ef657b1f2a584807adea923589e5a4470a1 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Wed, 1 Oct 2014 10:59:13 +0200
Subject: [PATCH 4/4] bluez: re-add DUN support for Bluez5
This adds service discovery via SDP and RFCOMM tty management to
NetworkManager, as it was dropped from Bluez.
Based on work by Dan Williams <dcbw@redhat.com>.
The SDP discovery is based on code from Bluez project.
(cherry picked from commit f1c9595311f52d8b79e8d2032e006005613a8fb1)
---
[lkundrak@v3.sk: contrib/fedora/rpm/NetworkManager.spec hunk removed for RPM]
configure.ac | 14 ++
contrib/fedora/rpm/NetworkManager.spec | 3 +
src/devices/bluetooth/Makefile.am | 10 +
src/devices/bluetooth/nm-bluez-device.c | 134 +++++++----
src/devices/bluetooth/nm-bluez5-dun.c | 409 ++++++++++++++++++++++++++++++++
src/devices/bluetooth/nm-bluez5-dun.h | 46 ++++
6 files changed, 573 insertions(+), 43 deletions(-)
create mode 100644 src/devices/bluetooth/nm-bluez5-dun.c
create mode 100644 src/devices/bluetooth/nm-bluez5-dun.h
diff --git a/configure.ac b/configure.ac
index d4437a6..d1ba66a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -586,6 +586,20 @@ else
fi
AM_CONDITIONAL(WITH_MODEM_MANAGER_1, test "${with_modem_manager_1}" = "yes")
+# Bluez5 DUN support
+PKG_CHECK_MODULES(BLUEZ5, [bluez >= 5], [have_bluez5=yes],[have_bluez5=no])
+AC_ARG_ENABLE(bluez5-dun, AS_HELP_STRING([--enable-bluez5-dun], [enable Bluez5 DUN support]),
+ [enable_bluez5_dun=${enableval}], [enable_bluez5_dun=${have_bluez5}])
+if (test "${enable_bluez5_dun}" = "yes"); then
+ if test x"$have_bluez5" = x"no"; then
+ AC_MSG_ERROR(Bluez 5.x development headers are required)
+ fi
+ AC_DEFINE(WITH_BLUEZ5_DUN, 1, [Define if you have Bluez 5 libraries])
+else
+ AC_DEFINE(HAVE_BLUEZ5_DUN, 0, [Define if you have Bluez 5 libraries])
+fi
+AM_CONDITIONAL(WITH_BLUEZ5_DUN, test "${enable_bluez5_dun}" = "yes")
+
# DHCP client support
AC_ARG_WITH([dhclient], AS_HELP_STRING([--with-dhclient=yes|no|path], [Enable dhclient 4.x support]))
AC_ARG_WITH([dhcpcd], AS_HELP_STRING([--with-dhcpcd=yes|no|path], [Enable dhcpcd 4.x support]))
diff --git a/src/devices/bluetooth/Makefile.am b/src/devices/bluetooth/Makefile.am
index 4342d4b..7840a21 100644
--- a/src/devices/bluetooth/Makefile.am
+++ b/src/devices/bluetooth/Makefile.am
@@ -64,6 +64,16 @@ libnm_device_plugin_bluetooth_la_LIBADD = \
$(DBUS_LIBS) \
$(GUDEV_LIBS)
+if WITH_BLUEZ5_DUN
+AM_CPPFLAGS += $(BLUEZ5_CFLAGS)
+
+libnm_device_plugin_bluetooth_la_SOURCES += \
+ nm-bluez5-dun.c \
+ nm-bluez5-dun.h
+
+libnm_device_plugin_bluetooth_la_LIBADD += $(BLUEZ5_LIBS)
+endif
+
CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST = $(SYMBOL_VIS_FILE)
diff --git a/src/devices/bluetooth/nm-bluez-device.c b/src/devices/bluetooth/nm-bluez-device.c
index edebb75..5ca370a 100644
--- a/src/devices/bluetooth/nm-bluez-device.c
+++ b/src/devices/bluetooth/nm-bluez-device.c
@@ -34,7 +34,8 @@
#include "nm-logging.h"
#include "nm-utils.h"
#include "nm-settings-connection.h"
-
+#include "nm-bluez5-dun.h"
+#include "NetworkManagerUtils.h"
G_DEFINE_TYPE (NMBluezDevice, nm_bluez_device, G_TYPE_OBJECT)
@@ -62,7 +63,8 @@ typedef struct {
guint32 capabilities;
gboolean connected;
- char *bt_iface;
+ char *b4_iface;
+ NMBluez5DunContext *b5_dun_context;
NMConnectionProvider *provider;
GSList *connections;
@@ -157,9 +159,12 @@ nm_bluez_device_get_capabilities (NMBluezDevice *self)
gboolean
nm_bluez_device_get_connected (NMBluezDevice *self)
{
+ NMBluezDevicePrivate *priv;
+
g_return_val_if_fail (NM_IS_BLUEZ_DEVICE (self), FALSE);
- return NM_BLUEZ_DEVICE_GET_PRIVATE (self)->connected;
+ priv = NM_BLUEZ_DEVICE_GET_PRIVATE (self);
+ return priv->connected;
}
static void
@@ -265,8 +270,7 @@ check_emit_usable (NMBluezDevice *self)
gboolean new_usable;
/* only expect the supported capabilities set. */
- g_assert (priv->bluez_version != 4 || ((priv->capabilities & ~(NM_BT_CAPABILITY_NAP | NM_BT_CAPABILITY_DUN)) == NM_BT_CAPABILITY_NONE ));
- g_assert (priv->bluez_version != 5 || ((priv->capabilities & ~(NM_BT_CAPABILITY_NAP )) == NM_BT_CAPABILITY_NONE ));
+ g_assert ((priv->capabilities & ~(NM_BT_CAPABILITY_NAP | NM_BT_CAPABILITY_DUN)) == NM_BT_CAPABILITY_NONE );
new_usable = (priv->initialized && priv->capabilities && priv->name &&
((priv->bluez_version == 4) ||
@@ -421,26 +425,33 @@ nm_bluez_device_disconnect (NMBluezDevice *self)
{
NMBluezDevicePrivate *priv = NM_BLUEZ_DEVICE_GET_PRIVATE (self);
GVariant *args = NULL;
- const char *dbus_iface;
+ const char *dbus_iface = NULL;
g_return_if_fail (priv->dbus_connection);
- if (priv->bluez_version == 5) {
- g_return_if_fail (priv->connection_bt_type == NM_BT_CAPABILITY_NAP);
- dbus_iface = BLUEZ5_NETWORK_INTERFACE;
- } else if (priv->bluez_version == 4 && priv->connection_bt_type == NM_BT_CAPABILITY_DUN) {
- /* Can't pass a NULL interface name through dbus to bluez, so just
- * ignore the disconnect if the interface isn't known.
- */
- if (!priv->bt_iface)
- return;
-
- args = g_variant_new ("(s)", priv->bt_iface),
- dbus_iface = BLUEZ4_SERIAL_INTERFACE;
- } else {
- g_return_if_fail (priv->bluez_version == 4 && priv->connection_bt_type == NM_BT_CAPABILITY_NAP);
- dbus_iface = BLUEZ4_NETWORK_INTERFACE;
- }
+ if (priv->connection_bt_type == NM_BT_CAPABILITY_DUN) {
+ if (priv->bluez_version == 4) {
+ /* Can't pass a NULL interface name through dbus to bluez, so just
+ * ignore the disconnect if the interface isn't known.
+ */
+ if (!priv->b4_iface)
+ goto out;
+ args = g_variant_new ("(s)", priv->b4_iface),
+ dbus_iface = BLUEZ4_SERIAL_INTERFACE;
+ } else if (priv->bluez_version == 5) {
+ nm_bluez5_dun_cleanup (priv->b5_dun_context);
+ priv->connected = FALSE;
+ goto out;
+ }
+ } else if (priv->connection_bt_type == NM_BT_CAPABILITY_NAP) {
+ if (priv->bluez_version == 4)
+ dbus_iface = BLUEZ4_NETWORK_INTERFACE;
+ else if (priv->bluez_version == 5)
+ dbus_iface = BLUEZ5_NETWORK_INTERFACE;
+ else
+ g_assert_not_reached ();
+ } else
+ g_assert_not_reached ();
g_dbus_connection_call (priv->dbus_connection,
BLUEZ_SERVICE,
@@ -455,6 +466,8 @@ nm_bluez_device_disconnect (NMBluezDevice *self)
(GAsyncReadyCallback) bluez_disconnect_cb,
g_object_ref (self));
+out:
+ g_clear_pointer (&priv->b4_iface, g_free);
priv->connection_bt_type = NM_BT_CAPABILITY_NONE;
}
@@ -481,7 +494,7 @@ bluez_connect_cb (GDBusConnection *dbus_connection,
g_simple_async_result_set_op_res_gpointer (result,
g_strdup (device),
g_free);
- priv->bt_iface = device;
+ priv->b4_iface = device;
g_variant_unref (variant);
}
@@ -490,6 +503,26 @@ bluez_connect_cb (GDBusConnection *dbus_connection,
g_object_unref (result_object);
}
+static void
+bluez5_dun_connect_cb (NMBluez5DunContext *context,
+ const char *device,
+ GError *error,
+ gpointer user_data)
+{
+ GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (user_data);
+
+ if (error) {
+ g_simple_async_result_take_error (result, error);
+ } else {
+ g_simple_async_result_set_op_res_gpointer (result,
+ g_strdup (device),
+ g_free);
+ }
+
+ g_simple_async_result_complete (result);
+ g_object_unref (result);
+}
+
void
nm_bluez_device_connect_async (NMBluezDevice *self,
NMBluetoothCapabilities connection_bt_type,
@@ -498,26 +531,35 @@ nm_bluez_device_connect_async (NMBluezDevice *self,
{
GSimpleAsyncResult *simple;
NMBluezDevicePrivate *priv = NM_BLUEZ_DEVICE_GET_PRIVATE (self);
- const char *dbus_iface;
- const char *connect_type = BLUETOOTH_CONNECT_NAP;
+ const char *dbus_iface = NULL;
+ const char *connect_type = NULL;
g_return_if_fail (priv->capabilities & connection_bt_type & (NM_BT_CAPABILITY_DUN | NM_BT_CAPABILITY_NAP));
- if (priv->bluez_version == 5) {
- g_return_if_fail (connection_bt_type == NM_BT_CAPABILITY_NAP);
- dbus_iface = BLUEZ5_NETWORK_INTERFACE;
- } else if (priv->bluez_version == 4 && connection_bt_type == NM_BT_CAPABILITY_DUN) {
- dbus_iface = BLUEZ4_SERIAL_INTERFACE;
- connect_type = BLUETOOTH_CONNECT_DUN;
- } else {
- g_return_if_fail (priv->bluez_version == 4 && connection_bt_type == NM_BT_CAPABILITY_NAP);
- dbus_iface = BLUEZ4_NETWORK_INTERFACE;
- }
-
simple = g_simple_async_result_new (G_OBJECT (self),
callback,
user_data,
nm_bluez_device_connect_async);
+ priv->connection_bt_type = connection_bt_type;
+
+ if (connection_bt_type == NM_BT_CAPABILITY_NAP) {
+ connect_type = BLUETOOTH_CONNECT_NAP;
+ if (priv->bluez_version == 4)
+ dbus_iface = BLUEZ4_NETWORK_INTERFACE;
+ else if (priv->bluez_version == 5)
+ dbus_iface = BLUEZ5_NETWORK_INTERFACE;
+ } else if (connection_bt_type == NM_BT_CAPABILITY_DUN) {
+ connect_type = BLUETOOTH_CONNECT_DUN;
+ if (priv->bluez_version == 4)
+ dbus_iface = BLUEZ4_SERIAL_INTERFACE;
+ else if (priv->bluez_version == 5) {
+ if (priv->b5_dun_context == NULL)
+ priv->b5_dun_context = nm_bluez5_dun_new (priv->adapter_address, priv->address);
+ nm_bluez5_dun_connect (priv->b5_dun_context, bluez5_dun_connect_cb, simple);
+ return;
+ }
+ } else
+ g_assert_not_reached ();
g_dbus_connection_call (priv->dbus_connection,
BLUEZ_SERVICE,
@@ -531,8 +573,6 @@ nm_bluez_device_connect_async (NMBluezDevice *self,
NULL,
(GAsyncReadyCallback) bluez_connect_cb,
simple);
-
- priv->connection_bt_type = connection_bt_type;
}
const char *
@@ -540,6 +580,7 @@ nm_bluez_device_connect_finish (NMBluezDevice *self,
GAsyncResult *result,
GError **error)
{
+ NMBluezDevicePrivate *priv = NM_BLUEZ_DEVICE_GET_PRIVATE (self);
GSimpleAsyncResult *simple;
const char *device;
@@ -554,6 +595,9 @@ nm_bluez_device_connect_finish (NMBluezDevice *self,
return NULL;
device = (const char *) g_simple_async_result_get_op_res_gpointer (simple);
+ if (device && priv->bluez_version == 5)
+ priv->connected = TRUE;
+
return device;
}
@@ -572,7 +616,7 @@ set_adapter_address (NMBluezDevice *self, const char *address)
}
static guint32
-convert_uuids_to_capabilities (const char **strings, int bluez_version)
+convert_uuids_to_capabilities (const char **strings)
{
const char **iter;
guint32 capabilities = 0;
@@ -584,8 +628,7 @@ convert_uuids_to_capabilities (const char **strings, int bluez_version)
if (parts && parts[0]) {
switch (g_ascii_strtoull (parts[0], NULL, 16)) {
case 0x1103:
- if (bluez_version == 4)
- capabilities |= NM_BT_CAPABILITY_DUN;
+ capabilities |= NM_BT_CAPABILITY_DUN;
break;
case 0x1116:
capabilities |= NM_BT_CAPABILITY_NAP;
@@ -606,7 +649,7 @@ _set_property_capabilities (NMBluezDevice *self, const char **uuids)
guint32 uint_val;
NMBluezDevicePrivate *priv = NM_BLUEZ_DEVICE_GET_PRIVATE (self);
- uint_val = convert_uuids_to_capabilities (uuids, priv->bluez_version);
+ uint_val = convert_uuids_to_capabilities (uuids);
if (priv->capabilities != uint_val) {
if (priv->capabilities) {
/* changing (relevant) capabilities is not supported and ignored -- except setting initially */
@@ -1067,6 +1110,11 @@ dispose (GObject *object)
g_clear_object (&priv->pan_connection_original);
}
+ if (priv->b5_dun_context) {
+ nm_bluez5_dun_free (priv->b5_dun_context);
+ priv->b5_dun_context = NULL;
+ }
+
g_signal_handlers_disconnect_by_func (priv->provider, cp_connection_added, self);
g_signal_handlers_disconnect_by_func (priv->provider, cp_connection_removed, self);
g_signal_handlers_disconnect_by_func (priv->provider, cp_connection_updated, self);
@@ -1098,7 +1146,7 @@ finalize (GObject *object)
g_free (priv->adapter_address);
g_free (priv->address);
g_free (priv->name);
- g_free (priv->bt_iface);
+ g_free (priv->b4_iface);
if (priv->proxy)
g_signal_handlers_disconnect_by_data (priv->proxy, object);
diff --git a/src/devices/bluetooth/nm-bluez5-dun.c b/src/devices/bluetooth/nm-bluez5-dun.c
new file mode 100644
index 0000000..dcd3d73
--- /dev/null
+++ b/src/devices/bluetooth/nm-bluez5-dun.c
@@ -0,0 +1,409 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager -- Network link manager
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Copyright (C) 2014 Red Hat, Inc.
+ */
+
+#include <config.h>
+#include <sys/socket.h>
+#include <bluetooth/sdp.h>
+#include <bluetooth/sdp_lib.h>
+#include <bluetooth/rfcomm.h>
+#include <net/ethernet.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+
+#include "nm-bluez5-dun.h"
+#include "nm-bt-error.h"
+#include "nm-logging.h"
+#include "NetworkManagerUtils.h"
+
+typedef struct _NMBluez5DunContext {
+ bdaddr_t src;
+ bdaddr_t dst;
+ char *src_str;
+ char *dst_str;
+ int rfcomm_channel;
+ int rfcomm_fd;
+ int rfcomm_tty_fd;
+ int rfcomm_id;
+ NMBluez5DunFunc callback;
+ gpointer user_data;
+ sdp_session_t *sdp_session;
+ guint sdp_watch_id;
+} NMBluez5DunContext;
+
+static void
+dun_connect (NMBluez5DunContext *context)
+{
+ struct sockaddr_rc sa;
+ int devid, try = 30;
+ char tty[100];
+ const int ttylen = sizeof (tty) - 1;
+ GError *error = NULL;
+
+ struct rfcomm_dev_req req = {
+ .flags = (1 << RFCOMM_REUSE_DLC) | (1 << RFCOMM_RELEASE_ONHUP),
+ .dev_id = -1,
+ .channel = context->rfcomm_channel
+ };
+
+ context->rfcomm_fd = socket (AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
+ if (context->rfcomm_fd < 0) {
+ int errsv = errno;
+ error = g_error_new (NM_BT_ERROR, NM_BT_ERROR_DUN_CONNECT_FAILED,
+ "Failed to create RFCOMM socket: (%d) %s",
+ errsv, strerror (errsv));
+ goto done;
+ }
+
+ /* Connect to the remote device */
+ sa.rc_family = AF_BLUETOOTH;
+ sa.rc_channel = 0;
+ memcpy (&sa.rc_bdaddr, &context->src, ETH_ALEN);
+ if (bind (context->rfcomm_fd, (struct sockaddr *) &sa, sizeof(sa))) {
+ int errsv = errno;
+ error = g_error_new (NM_BT_ERROR, NM_BT_ERROR_DUN_CONNECT_FAILED,
+ "Failed to bind socket: (%d) %s",
+ errsv, strerror (errsv));
+ goto done;
+ }
+
+ sa.rc_channel = context->rfcomm_channel;
+ memcpy (&sa.rc_bdaddr, &context->dst, ETH_ALEN);
+ if (connect (context->rfcomm_fd, (struct sockaddr *) &sa, sizeof (sa)) ) {
+ int errsv = errno;
+ error = g_error_new (NM_BT_ERROR, NM_BT_ERROR_DUN_CONNECT_FAILED,
+ "Failed to connect to remote device: (%d) %s",
+ errsv, strerror (errsv));
+ goto done;
+ }
+
+ nm_log_dbg (LOGD_BT, "(%s): connected to %s on channel %d",
+ context->src_str, context->dst_str, context->rfcomm_channel);
+
+ /* Create an RFCOMM kernel device for the DUN channel */
+ memcpy (&req.src, &context->src, ETH_ALEN);
+ memcpy (&req.dst, &context->dst, ETH_ALEN);
+ devid = ioctl (context->rfcomm_fd, RFCOMMCREATEDEV, &req);
+ if (devid < 0) {
+ int errsv = errno;
+ error = g_error_new (NM_BT_ERROR, NM_BT_ERROR_DUN_CONNECT_FAILED,
+ "Failed to create rfcomm device: (%d) %s",
+ errsv, strerror (errsv));
+ goto done;
+ }
+ context->rfcomm_id = devid;
+
+ snprintf (tty, ttylen, "/dev/rfcomm%d", devid);
+ while ((context->rfcomm_tty_fd = open (tty, O_RDONLY | O_NOCTTY)) < 0 && try--) {
+ if (try) {
+ g_usleep (100 * 1000);
+ continue;
+ }
+
+ error = g_error_new (NM_BT_ERROR, NM_BT_ERROR_DUN_CONNECT_FAILED,
+ "Failed to find rfcomm device: %s",
+ tty);
+ break;
+ }
+
+done:
+ context->callback (context, tty, error, context->user_data);
+}
+
+static void
+sdp_search_cleanup (NMBluez5DunContext *context)
+{
+ if (context->sdp_session) {
+ sdp_close (context->sdp_session);
+ context->sdp_session = NULL;
+ }
+
+ if (context->sdp_watch_id) {
+ g_source_remove (context->sdp_watch_id);
+ context->sdp_watch_id = 0;
+ }
+}
+
+static void
+sdp_search_completed_cb (uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *user_data)
+{
+ NMBluez5DunContext *context = user_data;
+ int scanned, seqlen = 0, bytesleft = size;
+ uint8_t dataType;
+ int channel = -1;
+
+ nm_log_dbg (LOGD_BT, "(%s -> %s): SDP search finished with type=%d status=%d",
+ context->src_str, context->dst_str, status, type);
+
+ /* SDP response received */
+ if (status || type != SDP_SVC_SEARCH_ATTR_RSP) {
+ GError *error = g_error_new (NM_BT_ERROR,
+ NM_BT_ERROR_DUN_CONNECT_FAILED,
+ "Did not get a Service Discovery response");
+ context->callback (context, NULL, error, context->user_data);
+ goto done;
+ }
+
+ scanned = sdp_extract_seqtype (rsp, bytesleft, &dataType, &seqlen);
+
+ nm_log_dbg (LOGD_BT, "(%s -> %s): SDP sequence type scanned=%d length=%d",
+ context->src_str, context->dst_str, scanned, seqlen);
+
+ scanned = sdp_extract_seqtype (rsp, bytesleft, &dataType, &seqlen);
+ if (!scanned || !seqlen) {
+ /* Short read or unknown sequence type */
+ GError *error = g_error_new (NM_BT_ERROR,
+ NM_BT_ERROR_DUN_CONNECT_FAILED,
+ "Improper Service Discovery response");
+ context->callback (context, NULL, error, context->user_data);
+ goto done;
+ }
+
+ rsp += scanned;
+ bytesleft -= scanned;
+ do {
+ sdp_record_t *rec;
+ int recsize = 0;
+ sdp_list_t *protos;
+
+ rec = sdp_extract_pdu (rsp, bytesleft, &recsize);
+ if (!rec)
+ break;
+
+ if (!recsize) {
+ sdp_record_free (rec);
+ break;
+ }
+
+ if (sdp_get_access_protos (rec, &protos) == 0) {
+ /* Extract the DUN channel number */
+ channel = sdp_get_proto_port (protos, RFCOMM_UUID);
+ sdp_list_free (protos, NULL);
+
+ nm_log_dbg (LOGD_BT, "(%s -> %s): SDP channel=%d",
+ context->src_str, context->dst_str, channel);
+ }
+ sdp_record_free (rec);
+
+ scanned += recsize;
+ rsp += recsize;
+ bytesleft -= recsize;
+ } while ((scanned < (ssize_t) size) && (bytesleft > 0) && (channel < 0));
+
+done:
+ if (channel != -1) {
+ context->rfcomm_channel = channel;
+ dun_connect (context);
+ }
+
+ sdp_search_cleanup (context);
+}
+
+static gboolean
+sdp_search_process_cb (GIOChannel *channel, GIOCondition condition, gpointer user_data)
+{
+ NMBluez5DunContext *context = user_data;
+
+ nm_log_dbg (LOGD_BT, "(%s -> %s): SDP search progressed with condition=%d",
+ context->src_str, context->dst_str, condition);
+
+ if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) {
+ GError *error = g_error_new (NM_BT_ERROR,
+ NM_BT_ERROR_DUN_CONNECT_FAILED,
+ "Service Discovery interrupted");
+ context->callback (context, NULL, error, context->user_data);
+ sdp_search_cleanup (context);
+ return FALSE;
+ }
+
+ if (sdp_process (context->sdp_session) < 0) {
+ nm_log_dbg (LOGD_BT, "(%s -> %s): SDP search finished",
+ context->src_str, context->dst_str);
+
+ /* Search finished successfully. */
+ return FALSE;
+ }
+
+ /* Search progressed successfully. */
+ return TRUE;
+}
+
+static gboolean
+sdp_connect_watch (GIOChannel *channel, GIOCondition condition, gpointer user_data)
+{
+ NMBluez5DunContext *context = user_data;
+ sdp_list_t *search, *attrs;
+ uuid_t svclass;
+ uint16_t attr;
+ int fd, err, fd_err = 0;
+ socklen_t len = sizeof (fd_err);
+ GError *error = NULL;
+
+ context->sdp_watch_id = 0;
+
+ fd = g_io_channel_unix_get_fd (channel);
+ if (getsockopt (fd, SOL_SOCKET, SO_ERROR, &fd_err, &len) < 0) {
+ nm_log_dbg (LOGD_BT, "(%s -> %s): getsockopt error=%d",
+ context->src_str, context->dst_str, errno);
+ err = errno;
+ } else {
+ nm_log_dbg (LOGD_BT, "(%s -> %s): SO_ERROR error=%d",
+ context->src_str, context->dst_str, fd_err);
+ err = fd_err;
+ }
+
+ if (err != 0) {
+ error = g_error_new (NM_BT_ERROR, NM_BT_ERROR_DUN_CONNECT_FAILED,
+ "Error on Service Discovery socket: (%d) %s",
+ err, strerror (err));
+ goto done;
+ }
+
+ if (sdp_set_notify (context->sdp_session, sdp_search_completed_cb, context) < 0) {
+ /* Should not be reached, only can fail if we passed bad sdp_session. */
+ error = g_error_new (NM_BT_ERROR, NM_BT_ERROR_DUN_CONNECT_FAILED,
+ "Could not request Service Discovery notification");
+ goto done;
+ }
+
+ sdp_uuid16_create (&svclass, DIALUP_NET_SVCLASS_ID);
+ search = sdp_list_append (NULL, &svclass);
+ attr = SDP_ATTR_PROTO_DESC_LIST;
+ attrs = sdp_list_append (NULL, &attr);
+
+ if (!sdp_service_search_attr_async (context->sdp_session, search, SDP_ATTR_REQ_INDIVIDUAL, attrs)) {
+ /* Set callback responsible for update the internal SDP transaction */
+ context->sdp_watch_id = g_io_add_watch (channel,
+ G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
+ sdp_search_process_cb,
+ context);
+ } else {
+ err = sdp_get_error (context->sdp_session);
+ error = g_error_new (NM_BT_ERROR,
+ NM_BT_ERROR_DUN_CONNECT_FAILED,
+ "Error starting Service Discovery: (%d) %s",
+ err, strerror (err));
+ }
+
+ sdp_list_free (attrs, NULL);
+ sdp_list_free (search, NULL);
+
+done:
+ if (error) {
+ context->callback (context, NULL, error, context->user_data);
+ sdp_search_cleanup (context);
+ }
+
+ return G_SOURCE_REMOVE;
+}
+
+NMBluez5DunContext *
+nm_bluez5_dun_new (const char *adapter,
+ const char *remote)
+
+{
+ NMBluez5DunContext *context;
+
+ context = g_slice_new0 (NMBluez5DunContext);
+ str2ba (adapter, &context->src);
+ str2ba (remote, &context->dst);
+ context->src_str = g_strdup (adapter);
+ context->dst_str = g_strdup (remote);
+ context->rfcomm_channel = -1;
+ context->rfcomm_id = -1;
+ context->rfcomm_fd = -1;
+ return context;
+}
+
+void
+nm_bluez5_dun_connect (NMBluez5DunContext *context,
+ NMBluez5DunFunc callback,
+ gpointer user_data)
+{
+ GIOChannel *channel;
+
+ context->callback = callback;
+ context->user_data = user_data;
+
+ if (context->rfcomm_channel != -1) {
+ nm_log_dbg (LOGD_BT, "(%s): channel number on device %s cached: %d",
+ context->src_str, context->dst_str, context->rfcomm_channel);
+ dun_connect (context);
+ return;
+ }
+
+ nm_log_dbg (LOGD_BT, "(%s): starting channel number discovery for device %s",
+ context->src_str, context->dst_str);
+
+ context->sdp_session = sdp_connect (&context->src, &context->dst, SDP_NON_BLOCKING);
+ if (!context->sdp_session) {
+ GError *error;
+ int err = sdp_get_error (context->sdp_session);
+
+ error = g_error_new (NM_BT_ERROR, NM_BT_ERROR_DUN_CONNECT_FAILED,
+ "Failed to connect to the SDP server: (%d) %s",
+ err, strerror (err));
+ context->callback (context, NULL, error, context->user_data);
+ return;
+ }
+
+ channel = g_io_channel_unix_new (sdp_get_socket (context->sdp_session));
+ context->sdp_watch_id = g_io_add_watch (channel,
+ G_IO_OUT | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
+ sdp_connect_watch,
+ context);
+ g_io_channel_unref (channel);
+}
+
+/* Only clean up connection-related stuff to allow reconnect */
+void
+nm_bluez5_dun_cleanup (NMBluez5DunContext *context)
+{
+ g_return_if_fail (context != NULL);
+
+ sdp_search_cleanup (context);
+
+ if (context->rfcomm_fd >= 0) {
+ if (context->rfcomm_id >= 0) {
+ struct rfcomm_dev_req req = { 0 };
+
+ req.dev_id = context->rfcomm_id;
+ ioctl (context->rfcomm_fd, RFCOMMRELEASEDEV, &req);
+ context->rfcomm_id = -1;
+ }
+ close (context->rfcomm_fd);
+ context->rfcomm_fd = -1;
+ }
+
+ close (context->rfcomm_tty_fd);
+ context->rfcomm_tty_fd = -1;
+}
+
+void
+nm_bluez5_dun_free (NMBluez5DunContext *context)
+{
+ g_return_if_fail (context != NULL);
+
+ nm_bluez5_dun_cleanup (context);
+ g_clear_pointer (&context->src_str, g_free);
+ g_clear_pointer (&context->dst_str, g_free);
+ g_slice_free (NMBluez5DunContext, context);
+}
diff --git a/src/devices/bluetooth/nm-bluez5-dun.h b/src/devices/bluetooth/nm-bluez5-dun.h
new file mode 100644
index 0000000..7e25972
--- /dev/null
+++ b/src/devices/bluetooth/nm-bluez5-dun.h
@@ -0,0 +1,46 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* NetworkManager -- Network link manager
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Copyright (C) 2014 Red Hat, Inc.
+ */
+
+#ifndef _NM_BLUEZ5_UTILS_H_
+#define _NM_BLUEZ5_UTILS_H_
+
+#include <glib.h>
+#include <gio/gio.h>
+
+typedef struct _NMBluez5DunContext NMBluez5DunContext;
+
+typedef void (*NMBluez5DunFunc) (NMBluez5DunContext *context,
+ const char *rfcomm_dev,
+ GError *error,
+ gpointer user_data);
+
+NMBluez5DunContext *nm_bluez5_dun_new (const char *adapter,
+ const char *remote);
+
+void nm_bluez5_dun_connect (NMBluez5DunContext *context,
+ NMBluez5DunFunc callback, gpointer user_data);
+
+/* Clean up connection resources */
+void nm_bluez5_dun_cleanup (NMBluez5DunContext *context);
+
+/* Clean up and dispose all resources */
+void nm_bluez5_dun_free (NMBluez5DunContext *context);
+
+#endif /* _NM_BLUEZ5_UTILS_H_ */
--
1.9.3

View File

@ -1,31 +0,0 @@
From 6a79acb03abc3406b3889738f8003e5f385af1eb Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Mon, 15 Sep 2014 11:35:53 +0200
Subject: [PATCH] core: only set IPv6 hop_limit for values greater than zero
A "Cur Hop Limit" field value of 0 in a router advertisement means
"unspecified by this router" and should not be set in the kernel.
(cherry picked from commit c668297257aef17f921518f6a7efac2ede2af76a)
---
src/devices/nm-device.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 291f03f..3d8baf8 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -3616,7 +3616,9 @@ rdisc_config_changed (NMRDisc *rdisc, NMRDiscConfigMap changed, NMDevice *device
}
}
- if (changed & NM_RDISC_CONFIG_HOP_LIMIT) {
+ /* hop_limit == 0 is a special value "unspecified", so do not touch
+ * in this case */
+ if (changed & NM_RDISC_CONFIG_HOP_LIMIT && rdisc->hop_limit > 0) {
char val[16];
g_snprintf (val, sizeof (val), "%d", rdisc->hop_limit);
--
1.9.3

View File

@ -1,73 +0,0 @@
From ace746df4e2936ab50224d9fbef88025b69d2379 Mon Sep 17 00:00:00 2001
From: Dan Winship <danw@gnome.org>
Date: Fri, 24 Oct 2014 13:48:46 -0400
Subject: [PATCH] platform: deal with default route being passed to
route_sync() (bgo 735325)
NMIP4Configs and NMIP6Configs are never supposed to contain a default
route, and thus nm_platform_ip6_route_sync() should never have to deal
with one. Unfortunately, if it *does* get passed a default route, it
will add it even if it was already there. This will result in an
RTM_NEWROUTE notification, which will cause NMPlatform to emit
ip6-route-changed, which will result in NMDevice doing some work and
then calling nm_ip6_config_commit(), which will result in NMIP6Config
passing the same list of routes to nm_platform_ip6_route_sync() again,
including the default route, which will cause NMPlatform to add the
route again...
(Something eventually causes this cycle to get broken, but it starts
up again the next time NM receives an RA.)
Fix this by having the route_sync() functions never add/modify the
default route (They were already not deleting it.)
---
src/platform/nm-platform.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
index 75e6448..5d478e8 100644
--- a/src/platform/nm-platform.c
+++ b/src/platform/nm-platform.c
@@ -1908,6 +1908,9 @@ array_contains_ip6_route (const GArray *routes, const NMPlatformIP6Route *route)
* with the least possible disturbance. It simply removes routes that are
* not listed and adds routes that are.
*
+ * @known_routes should not contain a default route; if it does, it will be
+ * ignored.
+ *
* Returns: %TRUE on success.
*/
gboolean
@@ -1938,6 +1941,9 @@ nm_platform_ip4_route_sync (int ifindex, const GArray *known_routes)
for (i = 0; i < known_routes->len && success; i++) {
known_route = &g_array_index (known_routes, NMPlatformIP4Route, i);
+ if (known_route->plen == 0)
+ continue;
+
if ((known_route->gateway == 0) ^ (i_type != 0)) {
/* Make two runs over the list of routes. On the first, only add
* device routes, on the second the others (gateway routes). */
@@ -1975,6 +1981,9 @@ nm_platform_ip4_route_sync (int ifindex, const GArray *known_routes)
* with the least possible disturbance. It simply removes routes that are
* not listed and adds routes that are.
*
+ * @known_routes should not contain a default route; if it does, it will be
+ * ignored.
+ *
* Returns: %TRUE on success.
*/
gboolean
@@ -2006,6 +2015,9 @@ nm_platform_ip6_route_sync (int ifindex, const GArray *known_routes)
for (i = 0; i < known_routes->len && success; i++) {
known_route = &g_array_index (known_routes, NMPlatformIP6Route, i);
+ if (known_route->plen == 0)
+ continue;
+
if (IN6_IS_ADDR_UNSPECIFIED (&known_route->gateway) ^ (i_type != 0)) {
/* Make two runs over the list of routes. On the first, only add
* device routes, on the second the others (gateway routes). */
--
1.9.3

View File

@ -1,114 +0,0 @@
From 45358f51fc0cc29d26cd70dcd16c884fb02d210d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
Date: Mon, 18 Aug 2014 12:41:01 +0200
Subject: [PATCH] cli: fix crash in `nmcli device wifi` with multiple wifi
devices (bgo #734466)
And separate details for particular devices with an empty line.
https://bugzilla.gnome.org/show_bug.cgi?id=734466
Reported-by: Martin Pitt <martinpitt@gnome.org>
(cherry picked from commit cc67c72b5e36a5776fa5665c61afdb8d33afc134)
---
cli/src/devices.c | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/cli/src/devices.c b/cli/src/devices.c
index a493387..d2e4c4f 100644
--- a/cli/src/devices.c
+++ b/cli/src/devices.c
@@ -1839,6 +1839,8 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv)
goto error;
}
} else {
+ gboolean empty_line = FALSE;
+
/* List APs for all devices */
if (bssid_user) {
/* Specific AP requested - list only that */
@@ -1850,6 +1852,7 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv)
/* Main header name */
nmc->print_fields.header_name = (char *) construct_header_name (base_hdr, nm_device_get_iface (dev));
+ nmc->print_fields.indices = parse_output_fields (fields_str, tmpl, FALSE, NULL, NULL);
arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_MAIN_HEADER_ADD | NMC_OF_FLAG_FIELD_NAMES);
g_ptr_array_add (nmc->output_data, arr);
@@ -1875,8 +1878,11 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv)
}
g_free (bssid_up);
}
+ if (empty_line)
+ printf ("\n"); /* Empty line between devices' APs */
print_data (nmc); /* Print all data */
nmc_empty_output_fields (nmc);
+ empty_line = TRUE;
}
if (!ap) {
g_string_printf (nmc->return_text, _("Error: Access point with bssid '%s' not found."),
@@ -1891,8 +1897,14 @@ do_device_wifi_list (NmCli *nmc, int argc, char **argv)
/* Main header name */
nmc->print_fields.header_name = (char *) construct_header_name (base_hdr,
nm_device_get_iface (dev));
- if (NM_IS_DEVICE_WIFI (dev))
+ nmc->print_fields.indices = parse_output_fields (fields_str, tmpl, FALSE, NULL, NULL);
+
+ if (NM_IS_DEVICE_WIFI (dev)) {
+ if (empty_line)
+ printf ("\n"); /* Empty line between devices' APs */
show_acces_point_info (dev, nmc);
+ empty_line = TRUE;
+ }
}
}
}
@@ -2572,6 +2584,8 @@ do_device_wimax_list (NmCli *nmc, int argc, char **argv)
goto error;
}
} else {
+ gboolean empty_line = FALSE;
+
/* List NSPs for all devices */
if (nsp_user) {
/* Specific NSP requested - list only that */
@@ -2584,6 +2598,7 @@ do_device_wimax_list (NmCli *nmc, int argc, char **argv)
/* Main header name */
nmc->print_fields.header_name = (char *) construct_header_name (base_hdr, nm_device_get_iface (dev));
+ nmc->print_fields.indices = parse_output_fields (fields_str, tmpl, FALSE, NULL, NULL);
arr = nmc_dup_fields_array (tmpl, tmpl_len, NMC_OF_FLAG_MAIN_HEADER_ADD | NMC_OF_FLAG_FIELD_NAMES);
g_ptr_array_add (nmc->output_data, arr);
@@ -2601,8 +2616,11 @@ do_device_wimax_list (NmCli *nmc, int argc, char **argv)
}
g_free (nsp_up);
}
+ if (empty_line)
+ printf ("\n"); /* Empty line between devices' NSPs */
print_data (nmc); /* Print all data */
nmc_empty_output_fields (nmc);
+ empty_line = TRUE;
}
if (!nsp) {
g_string_printf (nmc->return_text, _("Error: Access point with nsp '%s' not found."), nsp_user);
@@ -2616,9 +2634,14 @@ do_device_wimax_list (NmCli *nmc, int argc, char **argv)
/* Main header name */
nmc->print_fields.header_name = (char *) construct_header_name (base_hdr,
nm_device_get_iface (dev));
+ nmc->print_fields.indices = parse_output_fields (fields_str, tmpl, FALSE, NULL, NULL);
- if (NM_IS_DEVICE_WIMAX (dev))
+ if (NM_IS_DEVICE_WIMAX (dev)) {
+ if (empty_line)
+ printf ("\n"); /* Empty line between devices' NSPs */
show_nsp_info (dev, nmc);
+ empty_line = TRUE;
+ }
}
}
}
--
1.7.11.7

View File

@ -1,68 +0,0 @@
From d1d5196fd45c939d0d91d4a34b63e20b4b12bc34 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Sun, 9 Nov 2014 12:38:38 +0100
Subject: [PATCH 1/2] vpn: propagate daemon exec error correctly (bgo #739436)
NetworkManager[31624]: <warn> VPN service 'openvpn': could not launch the VPN service. error: (8) Failed to execute child process "/usr/local/libexec/nm-openvpn-service" (No such file or directory).
**
NetworkManager:ERROR:nm-manager.c:3094:_activation_auth_done: assertion failed: (error)
https://bugzilla.gnome.org/show_bug.cgi?id=739436
(cherry picked from commit 282d9b0e10c08dcda4a1d082b15dc2bdda8ee3d2)
---
src/vpn-manager/nm-vpn-service.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/vpn-manager/nm-vpn-service.c b/src/vpn-manager/nm-vpn-service.c
index 824543f..64eb78b 100644
--- a/src/vpn-manager/nm-vpn-service.c
+++ b/src/vpn-manager/nm-vpn-service.c
@@ -54,7 +54,7 @@ typedef struct {
#define VPN_CONNECTION_GROUP "VPN Connection"
-static gboolean start_pending_vpn (NMVPNService *self);
+static gboolean start_pending_vpn (NMVPNService *self, GError **error);
NMVPNService *
nm_vpn_service_new (const char *namefile, GError **error)
@@ -130,7 +130,7 @@ connection_vpn_state_changed (NMVPNConnection *connection,
g_signal_handlers_disconnect_by_func (connection, G_CALLBACK (connection_vpn_state_changed), self);
if (connection == priv->active) {
priv->active = NULL;
- start_pending_vpn (self);
+ start_pending_vpn (self, NULL);
} else
priv->pending = g_slist_remove (priv->pending, connection);
g_object_unref (connection);
@@ -253,7 +253,7 @@ start_active_vpn (NMVPNService *self, GError **error)
}
static gboolean
-start_pending_vpn (NMVPNService *self)
+start_pending_vpn (NMVPNService *self, GError **error)
{
NMVPNServicePrivate *priv = NM_VPN_SERVICE_GET_PRIVATE (self);
@@ -266,7 +266,7 @@ start_pending_vpn (NMVPNService *self)
priv->active = g_slist_nth_data (priv->pending, 0);
priv->pending = g_slist_remove (priv->pending, priv->active);
- return start_active_vpn (self, NULL);
+ return start_active_vpn (self, error);
}
gboolean
@@ -300,7 +300,7 @@ nm_vpn_service_activate (NMVPNService *service,
}
/* Otherwise start the next VPN */
- return start_pending_vpn (service);
+ return start_pending_vpn (service, error);
}
static void
--
1.7.11.7

View File

@ -1,64 +0,0 @@
From 05f686009a32e23815f7371b144f8dfa72f966d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
Date: Wed, 24 Sep 2014 16:02:37 +0200
Subject: [PATCH 2/2] core: do not assert when a device is enslaved externally
(rh #1167345)
Test case:
# ip link add name BR type bridge
# brctl addif BR eth0
Monitoring external master/slave changes was intruduced by
08e0cfb484dfc6aa6342871158ffe752c7c50f03.
https://bugzilla.redhat.com/show_bug.cgi?id=1167345
(cherry picked from commit c9b9229c2e7de2bbb12e493a868921b7a788ee92)
---
src/devices/nm-device.c | 4 ----
src/nm-active-connection.c | 4 ++--
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 35ee470..7d7d528 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -2966,8 +2966,6 @@ act_stage3_ip4_config_start (NMDevice *self,
g_assert (connection);
method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP4_CONFIG);
- if (priv->master)
- g_assert_cmpstr (method, ==, NM_SETTING_IP4_CONFIG_METHOD_DISABLED);
if ( strcmp (method, NM_SETTING_IP4_CONFIG_METHOD_MANUAL) != 0
&& priv->is_master
@@ -3864,8 +3862,6 @@ act_stage3_ip6_config_start (NMDevice *self,
g_assert (connection);
method = nm_utils_get_ip_config_method (connection, NM_TYPE_SETTING_IP6_CONFIG);
- if (priv->master)
- g_assert_cmpstr (method, ==, NM_SETTING_IP6_CONFIG_METHOD_IGNORE);
if ( strcmp (method, NM_SETTING_IP6_CONFIG_METHOD_MANUAL) != 0
&& priv->is_master
diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c
index 1ac67a9..2dc0688 100644
--- a/src/nm-active-connection.c
+++ b/src/nm-active-connection.c
@@ -371,11 +371,11 @@ device_master_changed (GObject *object,
return;
if (!nm_device_get_master (device))
return;
+ if (!nm_active_connection_get_master (self))
+ return;
g_signal_handlers_disconnect_by_func (device, G_CALLBACK (device_master_changed), self);
master = nm_active_connection_get_master (self);
- g_assert (master);
-
master_state = nm_active_connection_get_state (master);
if (master_state >= NM_ACTIVE_CONNECTION_STATE_DEACTIVATING) {
/* Master failed before attaching the slave */
--
1.7.11.7

View File

@ -5,15 +5,12 @@
%define wireless_tools_version 1:28-0pre9
%define libnl3_version 3.2.7
%define ppp_version 2.4.5
%if (0%{?fedora} && 0%{?fedora} > 20)
%define ppp_version 2.4.7
%endif
%define ppp_version %(rpm -q ppp-devel >/dev/null && rpm -q --qf '%%{version}' ppp-devel || echo -n bad)
%define snapshot .git20140704
%define git_sha 6eb82acd
%define realversion 0.9.10.0
%define release_version 14
%define snapshot %{nil}
%define git_sha %{nil}
%define realversion 1.0.0
%define release_version 1
%define epoch_version 1
%define obsoletes_nmver 1:0.9.9.95-1
@ -31,6 +28,7 @@
%global with_adsl 1
%global with_bluetooth 1
%global with_team 1
%global with_wifi 1
%global with_wimax 0
%global with_wwan 1
@ -40,6 +38,12 @@
%global with_wimax 1
%endif
# ModemManager on Fedora < 20 too old for Bluetooth && wwan
%if (0%{?fedora} && 0%{?fedora} < 20)
%global with_bluetooth 0
%global with_wwan 0
%endif
# Bluetooth requires the WWAN plugin
%if 0%{?with_bluetooth}
%global with_wwan 1
@ -54,10 +58,14 @@
%global with_wwan 0
%endif
%if 0%{?rhel} || (0%{?fedora} > 19)
%global with_teamctl 1
%if (0%{?fedora} && 0%{?fedora} <= 19)
%global with_team 0
%endif
%define with_modem_manager_1 0
%if 0%{?with_bluetooth} || (0%{?with_wwan} && (0%{?rhel} || (0%{?fedora} && 0%{?fedora} > 19)))
%define with_modem_manager_1 1
%endif
%global _hardened_build 1
@ -67,12 +75,12 @@ Name: NetworkManager
Summary: Network connection manager and user applications
Epoch: %{epoch_version}
Version: %{realversion}
Release: %{release_version}%{snapshot}%{?dist}
Release: %{release_version}%{snapshot}%{git_sha_version}%{?dist}
Group: System Environment/Base
License: GPLv2+
URL: http://www.gnome.org/projects/NetworkManager/
Source: %{name}-%{realversion}%{snapshot}%{git_sha_version}.tar.bz2
Source: %{name}-%{realversion}%{snapshot}%{git_sha_version}.tar.xz
Source1: NetworkManager.conf
Source2: 00-server.conf
Source3: 20-connectivity-fedora.conf
@ -80,18 +88,6 @@ Source3: 20-connectivity-fedora.conf
# Not upstream.
Patch0: 0000-explain-dns1-dns2.patch
# Cherry-picks from upstream:
# http://cgit.freedesktop.org/NetworkManager/NetworkManager/log/?h=nm-0-9-10
Patch1: 0001-policy-allow-non-local-admin-sessions-to-control-the.patch
Patch2: 0002-bluez-split-out-errors.patch
Patch3: 0003-bluez-track-adapter-address-in-NMBluezDevice.patch
Patch4: 0004-bluez-re-add-DUN-support-for-Bluez5.patch
Patch5: 0005-core-only-set-IPv6-hop_limit-for-values-greater-than.patch
Patch6: 0006-platform-deal-with-default-route-being-passed-to-rou.patch
Patch7: 0007-rh1159408-cli-multiple-wifi-devices-fix.patch
Patch8: 0008-bgo739436-vpn-service-assert-fix.patch
Patch9: 0009-rh1167345-external-master-slave-assert-fix.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%if 0%{?fedora} && 0%{?fedora} < 20
@ -109,7 +105,7 @@ Requires: glib2 >= %{glib2_version}
Requires: iproute
Requires: dhclient >= 12:4.1.0
Requires: libnl3 >= %{libnl3_version}
Requires: %{name}-glib%{?_isa} = %{epoch}:%{version}-%{release}
Requires: %{name}-libnm%{?_isa} = %{epoch}:%{version}-%{release}
Requires: ppp = %{ppp_version}
Requires: avahi-autoipd
Requires: dnsmasq
@ -137,11 +133,10 @@ BuildRequires: /usr/bin/autopoint
BuildRequires: pkgconfig
BuildRequires: libnl3-devel >= %{libnl3_version}
BuildRequires: perl(XML::Parser)
BuildRequires: perl(YAML)
BuildRequires: automake autoconf intltool libtool
BuildRequires: ppp = %{ppp_version}
BuildRequires: ppp-devel = %{ppp_version}
BuildRequires: ppp-devel >= 2.4.5
BuildRequires: nss-devel >= 3.11.7
BuildRequires: polkit-devel
BuildRequires: dhclient
BuildRequires: readline-devel
%if %{regen_docs}
@ -161,15 +156,17 @@ BuildRequires: wimax-devel
BuildRequires: systemd >= 200-3 systemd-devel
BuildRequires: libsoup-devel
BuildRequires: libndp-devel >= 1.0
%if (0%{?rhel} || (0%{?fedora} && 0%{?fedora} > 19))
%if 0%{?with_modem_manager_1}
BuildRequires: ModemManager-glib-devel >= 1.0
%endif
%if 0%{?with_nmtui}
BuildRequires: newt-devel
%endif
%if 0%{?with_teamctl}
BuildRequires: teamd-devel
%endif
BuildRequires: /usr/bin/dbus-launch
BuildRequires: pygobject3-base
BuildRequires: dbus-python
BuildRequires: libselinux-devel
BuildRequires: polkit-devel
%description
@ -213,6 +210,21 @@ This package contains NetworkManager support for Bluetooth devices.
%endif
%if 0%{?with_team}
%package team
Summary: Team device plugin for NetworkManager
Group: System Environment/Base
BuildRequires: teamd-devel
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
Obsoletes: NetworkManager < %{obsoletes_nmver}
# Team was split from main NM binary between 0.9.10 and 1.0
Obsoletes: NetworkManager < 1.0.0
%description team
This package contains NetworkManager support for team devices.
%endif
%if 0%{?with_wifi}
%package wifi
Summary: Wifi plugin for NetworkManager
@ -253,9 +265,9 @@ devices.
%package devel
Summary: Libraries and headers for adding NetworkManager support to applications
Summary: Headers defining the NetworkManager D-Bus APIs
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: dbus-devel >= %{dbus_version}
Requires: dbus-glib >= %{dbus_glib_version}
Requires: pkgconfig
@ -266,18 +278,19 @@ from applications.
%package glib
Summary: Libraries for adding NetworkManager support to applications that use glib.
Summary: Libraries for adding NetworkManager support to applications (old API).
Group: Development/Libraries
Requires: dbus >= %{dbus_version}
Requires: dbus-glib >= %{dbus_glib_version}
%description glib
This package contains the libraries that make it easier to use some NetworkManager
functionality from applications that use glib.
functionality from applications that use glib. This is the older NetworkManager API.
See also NetworkManager-libnm.
%package glib-devel
Summary: Header files for adding NetworkManager support to applications that use glib.
Summary: Header files for adding NetworkManager support to applications (old API).
Group: Development/Libraries
Requires: %{name}-devel%{?_isa} = %{epoch}:%{version}-%{release}
Requires: %{name}-glib%{?_isa} = %{epoch}:%{version}-%{release}
@ -287,7 +300,36 @@ Requires: dbus-glib-devel >= %{dbus_glib_version}
%description glib-devel
This package contains the header and pkg-config files for development applications using
NetworkManager functionality from applications that use glib.
NetworkManager functionality from applications that use glib. This is the older
NetworkManager API. See also NetworkManager-libnm-devel.
%package libnm
Summary: Libraries for adding NetworkManager support to applications (new API).
Group: Development/Libraries
Requires: dbus >= %{dbus_version}
Requires: dbus-glib >= %{dbus_glib_version}
%description libnm
This package contains the libraries that make it easier to use some NetworkManager
functionality from applications. This is the new NetworkManager API. See also
NetworkManager-glib.
%package libnm-devel
Summary: Header files for adding NetworkManager support to applications (new API).
Group: Development/Libraries
Requires: %{name}-devel%{?_isa} = %{epoch}:%{version}-%{release}
Requires: %{name}-libnm%{?_isa} = %{epoch}:%{version}-%{release}
Requires: glib2-devel
Requires: pkgconfig
Requires: dbus-glib-devel >= %{dbus_glib_version}
%description libnm-devel
This package contains the header and pkg-config files for development applications using
NetworkManager functionality from applications. This is the new NetworkManager API.
See also NetworkManager-glib-devel.
%package config-connectivity-fedora
Summary: NetworkManager config file for connectivity checking via Fedora servers
@ -300,7 +342,6 @@ via Fedora infrastructure.
%package config-server
Summary: NetworkManager config file for "server-like" defaults
Group: System Environment/Base
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
%description config-server
This adds a NetworkManager configuration file to make it behave more
@ -316,8 +357,8 @@ deployments.
%package tui
Summary: NetworkManager curses-based UI
Group: System Environment/Base
Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release}
Requires: %{name}-glib%{?_isa} = %{epoch}:%{version}-%{release}
Requires: %{name} = %{epoch}:%{version}-%{release}
Requires: %{name}-libnm%{?_isa} = %{epoch}:%{version}-%{release}
%description tui
This adds a curses-based "TUI" (Text User Interface) to
@ -329,15 +370,6 @@ by nm-connection-editor and nm-applet in a non-graphical environment.
%setup -q -n NetworkManager-%{realversion}
%patch0 -p1 -b .explain-dns1-dns2.orig
%patch1 -p1 -b .policy-allow-non-local-admin-sessions-to-control-the.orig
%patch2 -p1 -b .bluez-split-out-errors.orig
%patch3 -p1 -b .bluez-track-adapter-address-in-NMBluezDevice.orig
%patch4 -p1 -b .bluez-re-add-DUN-support-for-Bluez5.orig
%patch5 -p1 -b .core-only-set-IPv6-hop_limit-for-values-greater-than.orig
%patch6 -p1 -b .default-route-spam
%patch7 -p1 -b .rh1159408-cli-multiple-wifi-devices-fix.orig
%patch8 -p1 -b .bgo739436-vpn-service-assert-fix.patch.orig
%patch9 -p1 -b .rh1167345-external-master-slave-assert-fix.orig
%build
@ -357,7 +389,7 @@ intltoolize --force
--with-crypto=nss \
--enable-more-warnings=error \
--enable-ppp=yes \
%if 0%{?rhel} || (0%{?fedora} > 19)
%if 0%{?with_modem_manager_1}
--with-modem-manager-1=yes \
%else
--with-modem-manager-1=no \
@ -378,12 +410,14 @@ intltoolize --force
%else
--with-wext=no \
%endif
%if 0%{?with_teamctl}
%if 0%{?with_team}
--enable-teamdctl=yes \
%else
--enable-teamdctl=no \
%endif
--with-selinux=yes \
--enable-polkit=yes \
--enable-polkit-agent \
--enable-modify-system=yes \
--enable-concheck \
--with-session-tracking=systemd \
@ -396,7 +430,8 @@ intltoolize --force
--enable-ifcfg-rh=yes \
--with-system-libndp=yes \
--with-pppd-plugin-dir=%{_libdir}/pppd/%{ppp_version} \
--with-dist-version=%{version}-%{release}
--with-dist-version=%{version}-%{release} \
--with-setting-plugins-default='ifcfg-rh,ibft'
make %{?_smp_mflags}
@ -431,8 +466,6 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/conf.d
%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/pppd/%{ppp_version}/*.la
%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/NetworkManager/*.la
install -m 0755 test/.libs/nm-online %{buildroot}/%{_bindir}
%if %{regen_docs}
# install the pristine docs
%{__cp} ORIG-docs/libnm-glib/html/* $RPM_BUILD_ROOT%{_datadir}/gtk-doc/html/libnm-glib/
@ -485,8 +518,12 @@ fi
%{_libexecdir}/nm-dhcp-helper
%{_libexecdir}/nm-avahi-autoipd.action
%{_libexecdir}/nm-dispatcher
%{_libexecdir}/nm-iface-helper
%dir %{_libdir}/NetworkManager
%{_libdir}/NetworkManager/libnm-settings-plugin*.so
%if 0%{?with_nmtui}
%exclude %{_mandir}/man1/nmtui*
%endif
%{_mandir}/man1/*
%{_mandir}/man5/*
%{_mandir}/man8/*
@ -517,8 +554,12 @@ fi
%files bluetooth
%defattr(-,root,root,0755)
%{_libdir}/%{name}/libnm-device-plugin-bluetooth.so
%else
%exclude %{_libdir}/%{name}/libnm-device-plugin-bluetooth.so
%endif
%if 0%{?with_team}
%files team
%defattr(-,root,root,0755)
%{_libdir}/%{name}/libnm-device-plugin-team.so
%endif
%if 0%{?with_wifi}
@ -534,17 +575,12 @@ fi
%defattr(-,root,root,0755)
%{_libdir}/%{name}/libnm-device-plugin-wwan.so
%{_libdir}/%{name}/libnm-wwan.so
%else
%exclude %{_libdir}/%{name}/libnm-device-plugin-wwan.so
%exclude %{_libdir}/%{name}/libnm-wwan.so
%endif
%if 0%{?with_wimax}
%files wimax
%defattr(-,root,root,0755)
%{_libdir}/%{name}/libnm-device-plugin-wimax.so
%else
%exclude %{_libdir}/%{name}/libnm-device-plugin-wimax.so
%endif
%files devel
@ -589,6 +625,21 @@ fi
%dir %{_datadir}/gtk-doc/html/libnm-util
%{_datadir}/gtk-doc/html/libnm-util/*
%files libnm
%defattr(-,root,root,0755)
%{_libdir}/libnm.so.*
%{_libdir}/girepository-1.0/NM-1.0.typelib
%files libnm-devel
%defattr(-,root,root,0755)
%dir %{_includedir}/libnm
%{_includedir}/libnm/*.h
%{_libdir}/pkgconfig/libnm.pc
%{_libdir}/libnm.so
%{_datadir}/gir-1.0/NM-1.0.gir
%dir %{_datadir}/gtk-doc/html/libnm
%{_datadir}/gtk-doc/html/libnm/*
%files config-connectivity-fedora
%defattr(-,root,root,0755)
%dir %{_sysconfdir}/%{name}
@ -597,6 +648,7 @@ fi
%files config-server
%defattr(-,root,root,0755)
%dir %{_sysconfdir}/%{name}
%dir %{_sysconfdir}/%{name}/conf.d
%config(noreplace) %{_sysconfdir}/%{name}/conf.d/00-server.conf
@ -606,9 +658,13 @@ fi
%{_bindir}/nmtui-edit
%{_bindir}/nmtui-connect
%{_bindir}/nmtui-hostname
%{_mandir}/man1/nmtui*
%endif
%changelog
* Mon Dec 22 2014 Dan Williams <dcbw@redhat.com> - 1:1.0.0-1
- Update to 1.0
* Mon Nov 24 2014 Jiří Klimeš <jklimes@redhat.com> - 1:0.9.10.0-14.git20140704
- vpn: propagate daemon exec error correctly (bgo #739436)
- core: do not assert when a device is enslaved externally (rh #1167345)

View File

@ -1 +1 @@
94d9a02ce5afcec1b5bcf965f2459004 NetworkManager-0.9.10.0.git20140704.6eb82acd.tar.bz2
71cae8707a90fa92e28cafbc9262b548 NetworkManager-1.0.0.tar.xz