NetworkManager/clients/common
Thomas Haller abdf9a3673 all: change handling of connection.type for bluetooth NAP and in general
Branch f9b1bc16e9 added bluetooth NAP
support. A NAP connection is of connection.type "bluetooth", but it
also has a "bridge" setting. Also, it is primarily handled by NMDeviceBridge
and NMBridgeDeviceFactory (with help from NMBluezManager).

However, don't let nm_connection_get_connection_type() and
nm_connnection_is_type() lie about what the connection.type is.
The type is "bluetooth" for most purposes -- at least, as far as
the client is concerned (and the public API of libnm). This restores
previous API behavior, where nm_connection_get_connection_type()
and nm_connection_is_type() would be simple accessors to the
"connection.type" property.

Only a few places care about the bridge aspect, and those places need special
treatment. For example NMDeviceBridge needs to be fully aware that it can
handle bluetooth NAP connection. That is nothing new: if you handle a
connection of any type, you must know which fields matter and what they
mean. It's not enough that nm_connection_get_connection_type() for bluetooth
NAP connectins is claiming to be a bridge.

Counter examples, where the original behavior is right:

src/nm-manager.c-        g_set_error (error,
src/nm-manager.c-                     NM_MANAGER_ERROR,
src/nm-manager.c-                     NM_MANAGER_ERROR_FAILED,
src/nm-manager.c-                     "NetworkManager plugin for '%s' unavailable",
src/nm-manager.c:                     nm_connection_get_connection_type (connection));

the correct message is: "no bluetooth plugin available", not "bridge".

src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c:   if (   (   nm_connection_is_type (connection, NM_SETTING_WIRED_SETTING_NAME)
src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c:           && !nm_connection_get_setting_pppoe (connection))
src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c:       || nm_connection_is_type (connection, NM_SETTING_VLAN_SETTING_NAME)
src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c:       || nm_connection_is_type (connection, NM_SETTING_WIRELESS_SETTING_NAME)
src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c:       || nm_connection_is_type (connection, NM_SETTING_INFINIBAND_SETTING_NAME)
src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c:       || nm_connection_is_type (connection, NM_SETTING_BOND_SETTING_NAME)
src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c:       || nm_connection_is_type (connection, NM_SETTING_TEAM_SETTING_NAME)
src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c:       || nm_connection_is_type (connection, NM_SETTING_BRIDGE_SETTING_NAME))
src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c-        return TRUE;

the correct behavior is for ifcfg-rh plugin to reject bluetooth NAP
connections, not proceed and store it.
2017-06-07 09:07:17 +02:00
..
tests cli: make properties list a list of pointers 2017-04-13 10:10:12 +02:00
nm-client-utils.c clients: replace nmc_string_to_int() by _nm_utils_ascii_str_to_int64() 2017-05-23 13:37:10 +02:00
nm-client-utils.h clients: replace nmc_string_to_int() by _nm_utils_ascii_str_to_int64() 2017-05-23 13:37:10 +02:00
nm-meta-setting-access.c cli: make properties list a list of pointers 2017-04-13 10:10:12 +02:00
nm-meta-setting-access.h cli: make properties list a list of pointers 2017-04-13 10:10:12 +02:00
nm-meta-setting-desc.c clients: add support for Bluetooth NAP type 2017-05-31 20:17:42 +02:00
nm-meta-setting-desc.h clients: add support for Bluetooth NAP type 2017-05-31 20:17:42 +02:00
nm-polkit-listener.c all: cleanup includes and let "nm-default.h" include "config.h" 2016-02-19 17:53:25 +01:00
nm-polkit-listener.h all: cleanup includes in header files 2016-08-17 19:51:17 +02:00
nm-secret-agent-simple.c all: change handling of connection.type for bluetooth NAP and in general 2017-06-07 09:07:17 +02:00
nm-secret-agent-simple.h include: use double-quotes to include our own headers 2017-03-09 14:12:35 +01:00
nm-vpn-helpers.c cli: make static arrays in nm_vpn_get_secret_names() const 2017-04-05 14:18:55 +02:00
nm-vpn-helpers.h include: use double-quotes to include our own headers 2017-03-09 14:12:35 +01:00
settings-docs.c.in all: fix typos in documentation, translated strings and comments 2017-05-28 17:33:37 +02:00
settings-docs.xsl cli: fix marking settings docs for translation 2017-04-23 23:45:02 +02:00