diff options
Diffstat (limited to 'libnm')
| -rw-r--r-- | libnm/NetworkManager.h | 2 | ||||
| -rw-r--r-- | libnm/libnm.ver | 1 | ||||
| -rw-r--r-- | libnm/meson.build | 2 | ||||
| -rw-r--r-- | libnm/nm-access-point.c | 9 | ||||
| -rw-r--r-- | libnm/nm-active-connection.c | 1 | ||||
| -rw-r--r-- | libnm/nm-checkpoint.c | 1 | ||||
| -rw-r--r-- | libnm/nm-client.c | 15 | ||||
| -rw-r--r-- | libnm/nm-client.h | 1 | ||||
| -rw-r--r-- | libnm/nm-device-adsl.c | 1 | ||||
| -rw-r--r-- | libnm/nm-device-ethernet.c | 4 | ||||
| -rw-r--r-- | libnm/nm-device-macvlan.c | 1 | ||||
| -rw-r--r-- | libnm/nm-device.c | 3 | ||||
| -rw-r--r-- | libnm/nm-ip-config.c | 2 | ||||
| -rw-r--r-- | libnm/nm-manager.c | 4 | ||||
| -rw-r--r-- | libnm/nm-object.c | 2 | ||||
| -rw-r--r-- | libnm/nm-property-docs.xml | 10 | ||||
| -rw-r--r-- | libnm/nm-remote-connection.h | 1 | ||||
| -rw-r--r-- | libnm/nm-remote-settings.c | 5 | ||||
| -rw-r--r-- | libnm/nm-secret-agent-old.c | 2 | ||||
| -rw-r--r-- | libnm/nm-settings-docs.xml | 10 | ||||
| -rw-r--r-- | libnm/nm-vpn-connection.c | 1 | ||||
| -rw-r--r-- | libnm/nm-vpn-plugin-old.c | 1 | ||||
| -rw-r--r-- | libnm/nm-vpn-service-plugin.c | 2 | ||||
| -rw-r--r-- | libnm/tests/meson.build | 30 | ||||
| -rw-r--r-- | libnm/tests/test-nm-client.c | 38 | ||||
| -rw-r--r-- | libnm/tests/test-remote-settings-client.c | 21 | ||||
| -rw-r--r-- | libnm/tests/test-secret-agent.c | 25 |
27 files changed, 127 insertions, 68 deletions
diff --git a/libnm/NetworkManager.h b/libnm/NetworkManager.h index e04911c6..9226aa35 100644 --- a/libnm/NetworkManager.h +++ b/libnm/NetworkManager.h @@ -38,12 +38,14 @@ #include "nm-device-generic.h" #include "nm-device-infiniband.h" #include "nm-device-ip-tunnel.h" +#include "nm-device-macsec.h" #include "nm-device-macvlan.h" #include "nm-device-modem.h" #include "nm-device-olpc-mesh.h" #include "nm-device-ovs-interface.h" #include "nm-device-ovs-port.h" #include "nm-device-ovs-bridge.h" +#include "nm-device-ppp.h" #include "nm-device-team.h" #include "nm-device-tun.h" #include "nm-device-vlan.h" diff --git a/libnm/libnm.ver b/libnm/libnm.ver index 564cdb39..ec1b91da 100644 --- a/libnm/libnm.ver +++ b/libnm/libnm.ver @@ -1348,6 +1348,7 @@ global: nm_client_checkpoint_rollback; nm_client_checkpoint_rollback_finish; nm_client_get_checkpoints; + nm_connection_get_setting_tc_config; nm_device_ip_tunnel_get_flags; nm_ip_tunnel_flags_get_type; nm_remote_connection_get_flags; diff --git a/libnm/meson.build b/libnm/meson.build index 4e985b0a..91fe972e 100644 --- a/libnm/meson.build +++ b/libnm/meson.build @@ -10,7 +10,6 @@ deps = [ cflags = [ '-DG_LOG_DOMAIN="@0@"'.format(libnm_name), '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM', - '-DNMRUNDIR="@0@"'.format(nm_pkgrundir) ] if have_fake_typelibs @@ -30,6 +29,7 @@ libnm_headers = files( 'NetworkManager.h', 'nm-access-point.h', 'nm-active-connection.h', + 'nm-autoptr.h', 'nm-checkpoint.h', 'nm-client.h', 'nm-device-adsl.h', diff --git a/libnm/nm-access-point.c b/libnm/nm-access-point.c index 2e6244c6..75ea5570 100644 --- a/libnm/nm-access-point.c +++ b/libnm/nm-access-point.c @@ -144,9 +144,9 @@ nm_access_point_get_ssid (NMAccessPoint *ap) * nm_access_point_get_frequency: * @ap: a #NMAccessPoint * - * Gets the frequency of the access point. + * Gets the frequency of the access point in MHz. * - * Returns: the frequency + * Returns: the frequency in MHz **/ guint32 nm_access_point_get_frequency (NMAccessPoint *ap) @@ -209,9 +209,9 @@ nm_access_point_get_max_bitrate (NMAccessPoint *ap) * nm_access_point_get_strength: * @ap: a #NMAccessPoint * - * Gets the current signal strength of the access point. + * Gets the current signal strength of the access point as a percentage. * - * Returns: the signal strength + * Returns: the signal strength (0 to 100) **/ guint8 nm_access_point_get_strength (NMAccessPoint *ap) @@ -483,7 +483,6 @@ init_dbus (NMObject *object) property_info); } - static void nm_access_point_class_init (NMAccessPointClass *ap_class) { diff --git a/libnm/nm-active-connection.c b/libnm/nm-active-connection.c index 6560fb8e..0314667f 100644 --- a/libnm/nm-active-connection.c +++ b/libnm/nm-active-connection.c @@ -580,7 +580,6 @@ init_dbus (NMObject *object) property_info); } - static void nm_active_connection_class_init (NMActiveConnectionClass *ap_class) { diff --git a/libnm/nm-checkpoint.c b/libnm/nm-checkpoint.c index 890e2f85..153a7104 100644 --- a/libnm/nm-checkpoint.c +++ b/libnm/nm-checkpoint.c @@ -163,7 +163,6 @@ init_dbus (NMObject *object) property_info); } - static void nm_checkpoint_class_init (NMCheckpointClass *checkpoint_class) { diff --git a/libnm/nm-client.c b/libnm/nm-client.c index a31a0845..18d3e318 100644 --- a/libnm/nm-client.c +++ b/libnm/nm-client.c @@ -110,6 +110,7 @@ typedef struct { GDBusObjectManager *object_manager; GCancellable *new_object_manager_cancellable; struct udev *udev; + bool udev_inited:1; } NMClientPrivate; enum { @@ -754,7 +755,6 @@ nm_client_check_connectivity_finish (NMClient *client, return (NMConnectivityState) g_simple_async_result_get_op_res_gssize (simple); } - /** * nm_client_save_hostname: * @client: the %NMClient @@ -2604,9 +2604,14 @@ obj_nm_for_gdbus_object (NMClient *self, GDBusObject *object, GDBusObjectManager NULL); if (NM_IS_DEVICE (obj_nm)) { priv = NM_CLIENT_GET_PRIVATE (self); - if (!priv->udev) - priv->udev = udev_new (); - _nm_device_set_udev (NM_DEVICE (obj_nm), priv->udev); + if (G_UNLIKELY (!priv->udev_inited)) { + priv->udev_inited = TRUE; + /* for testing, we don't want to use udev in libnm. */ + if (!nm_streq0 (g_getenv ("LIBNM_USE_NO_UDEV"), "1")) + priv->udev = udev_new (); + } + if (priv->udev) + _nm_device_set_udev (NM_DEVICE (obj_nm), priv->udev); } g_object_set_qdata_full (G_OBJECT (object), _nm_object_obj_nm_quark (), obj_nm, g_object_unref); @@ -2623,7 +2628,6 @@ obj_nm_inited (GObject *object, GAsyncResult *result, gpointer user_data) } } - static void object_added (GDBusObjectManager *object_manager, GDBusObject *object, gpointer user_data) { @@ -2740,7 +2744,6 @@ objects_created (NMClient *client, GDBusObjectManager *object_manager, GError ** G_CALLBACK (dns_notify), client); } - /* The handlers don't really use the client instance. However * it makes it convenient to unhook them by data. */ g_signal_connect (object_manager, "object-added", diff --git a/libnm/nm-client.h b/libnm/nm-client.h index 6f4a86c9..6259b122 100644 --- a/libnm/nm-client.h +++ b/libnm/nm-client.h @@ -403,7 +403,6 @@ const char *nm_client_get_dns_rc_manager (NMClient *client); NM_AVAILABLE_IN_1_6 const GPtrArray *nm_client_get_dns_configuration (NMClient *client); - NM_AVAILABLE_IN_1_12 const GPtrArray *nm_client_get_checkpoints (NMClient *client); diff --git a/libnm/nm-device-adsl.c b/libnm/nm-device-adsl.c index 3285745d..a82aa8d0 100644 --- a/libnm/nm-device-adsl.c +++ b/libnm/nm-device-adsl.c @@ -30,7 +30,6 @@ #include "nm-setting-adsl.h" #include "nm-setting-connection.h" - G_DEFINE_TYPE (NMDeviceAdsl, nm_device_adsl, NM_TYPE_DEVICE) #define NM_DEVICE_ADSL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_ADSL, NMDeviceAdslPrivate)) diff --git a/libnm/nm-device-ethernet.c b/libnm/nm-device-ethernet.c index 727ea8a6..ebb019dc 100644 --- a/libnm/nm-device-ethernet.c +++ b/libnm/nm-device-ethernet.c @@ -92,9 +92,9 @@ nm_device_ethernet_get_permanent_hw_address (NMDeviceEthernet *device) * nm_device_ethernet_get_speed: * @device: a #NMDeviceEthernet * - * Gets the speed of the #NMDeviceEthernet. + * Gets the speed of the #NMDeviceEthernet in Mbit/s. * - * Returns: the speed of the device + * Returns: the speed of the device in Mbit/s **/ guint32 nm_device_ethernet_get_speed (NMDeviceEthernet *device) diff --git a/libnm/nm-device-macvlan.c b/libnm/nm-device-macvlan.c index e6477219..23c649cc 100644 --- a/libnm/nm-device-macvlan.c +++ b/libnm/nm-device-macvlan.c @@ -143,7 +143,6 @@ nm_device_macvlan_get_hw_address (NMDeviceMacvlan *device) return nm_str_not_empty (NM_DEVICE_MACVLAN_GET_PRIVATE (device)->hw_address); } - static gboolean connection_compatible (NMDevice *device, NMConnection *connection, GError **error) { diff --git a/libnm/nm-device.c b/libnm/nm-device.c index 9bb8f391..57f0bedd 100644 --- a/libnm/nm-device.c +++ b/libnm/nm-device.c @@ -1819,7 +1819,7 @@ nm_device_get_physical_port_id (NMDevice *device) * * Gets the MTU of the #NMDevice. * - * Returns: the MTU of the device. + * Returns: the MTU of the device in bytes. **/ guint32 nm_device_get_mtu (NMDevice *device) @@ -1940,7 +1940,6 @@ nm_device_reapply (NMDevice *device, if (!dict) dict = g_variant_new_array (G_VARIANT_TYPE ("{sa{sv}}"), NULL, 0); - ret = nmdbus_device_call_reapply_sync (NM_DEVICE_GET_PRIVATE (device)->proxy, dict, version_id, flags, cancellable, error); if (error && *error) diff --git a/libnm/nm-ip-config.c b/libnm/nm-ip-config.c index ca99b1d4..d1a69f38 100644 --- a/libnm/nm-ip-config.c +++ b/libnm/nm-ip-config.c @@ -491,7 +491,7 @@ nm_ip_config_get_wins_servers (NMIPConfig *config) * Gets the routes. * * Returns: (element-type NMIPRoute) (transfer none): the #GPtrArray containing - * #NMIPRoutes. This is the internal copy used by the configuration, and must + * #NMIPRoute<!-- -->s. This is the internal copy used by the configuration, and must * not be modified. The library never modifies the returned array and thus it is * safe for callers to reference and keep using it. * diff --git a/libnm/nm-manager.c b/libnm/nm-manager.c index 2b9e0d96..aac120c6 100644 --- a/libnm/nm-manager.c +++ b/libnm/nm-manager.c @@ -1049,7 +1049,7 @@ nm_manager_activate_connection_async (NMManager *manager, nmdbus_manager_call_activate_connection (priv->proxy, connection ? nm_connection_get_path (connection) : "/", device ? nm_object_get_path (NM_OBJECT (device)) : "/", - specific_object ? specific_object : "/", + specific_object ?: "/", cancellable, activate_cb, info); } @@ -1133,7 +1133,7 @@ nm_manager_add_and_activate_connection_async (NMManager *manager, nmdbus_manager_call_add_and_activate_connection (priv->proxy, dict, nm_object_get_path (NM_OBJECT (device)), - specific_object ? specific_object : "/", + specific_object ?: "/", cancellable, add_activate_cb, info); } diff --git a/libnm/nm-object.c b/libnm/nm-object.c index 605da492..f162b15d 100644 --- a/libnm/nm-object.c +++ b/libnm/nm-object.c @@ -968,7 +968,7 @@ _nm_object_register_properties (NMObject *object, } pi = g_malloc0 (sizeof (PropertyInfo)); - pi->func = tmp->func ? tmp->func : demarshal_generic; + pi->func = tmp->func ?: demarshal_generic; pi->object_type = tmp->object_type; pi->field = tmp->field; pi->signal_prefix = tmp->signal_prefix; diff --git a/libnm/nm-property-docs.xml b/libnm/nm-property-docs.xml index 029477d9..a8b809bd 100644 --- a/libnm/nm-property-docs.xml +++ b/libnm/nm-property-docs.xml @@ -21,7 +21,7 @@ <property name="read-only" name_upper="READ_ONLY" type="boolean" default="FALSE" description="FALSE if the connection can be modified using the provided settings service's D-Bus interface with the right privileges, or TRUE if the connection is read-only and cannot be modified." /> <property name="secondaries" name_upper="SECONDARIES" type="array of string" default="[]" description="List of connection UUIDs that should be activated when the base connection itself is activated. Currently only VPN connections are supported." /> <property name="slave-type" name_upper="SLAVE_TYPE" type="string" description="Setting name of the device type of this slave's master connection (eg, "bond"), or NULL if this connection is not a slave." /> - <property name="stable-id" name_upper="STABLE_ID" type="string" description="Token to generate stable IDs for the connection. The stable-id is used for generating IPv6 stable private addresses with ipv6.addr-gen-mode=stable-privacy. It is also used to seed the generated cloned MAC address for ethernet.cloned-mac-address=stable and wifi.cloned-mac-address=stable. It is also used as DHCP client identifier with ipv4.dhcp-client-id=stable. Note that also the interface name of the activating connection and a per-host secret key is included into the address generation so that the same stable-id on different hosts/devices yields different addresses. If the value is unset, an ID unique for the connection is used. Specifying a stable-id allows multiple connections to generate the same addresses. Another use is to generate IDs at runtime via dynamic substitutions. The '$' character is treated special to perform dynamic substitutions at runtime. Currently supported are "${CONNECTION}", "${BOOT}", "${RANDOM}". These effectively create unique IDs per-connection, per-boot, or every time. Any unrecognized patterns following '$' are treated verbatim, however are reserved for future use. You are thus advised to avoid '$' or escape it as "$$". For example, set it to "${CONNECTION}/${BOOT}" to create a unique id for this connection that changes with every reboot. Note that two connections only use the same effective id if their stable-id is also identical before performing dynamic substitutions." /> + <property name="stable-id" name_upper="STABLE_ID" type="string" description="This represents the identity of the connection used for various purposes. It allows to configure multiple profiles to share the identity. Also, the stable-id can contain placeholders that are substituted dynamically and deterministically depending on the context. The stable-id is used for generating IPv6 stable private addresses with ipv6.addr-gen-mode=stable-privacy. It is also used to seed the generated cloned MAC address for ethernet.cloned-mac-address=stable and wifi.cloned-mac-address=stable. It is also used as DHCP client identifier with ipv4.dhcp-client-id=stable. Note that depending on the context where it is used, other parameters are also seeded into the generation algorithm. For example, a per-host key is commonly also included, so that different systems end up generating different IDs. Or with ipv6.addr-gen-mode=stable-privacy, also the device's name is included, so that different interfaces yield different addresses. The '$' character is treated special to perform dynamic substitutions at runtime. Currently supported are "${CONNECTION}", "${DEVICE}", "${BOOT}", "${RANDOM}". These effectively create unique IDs per-connection, per-device, per-boot, or every time. Note that "${DEVICE}" corresponds the the interface name of the device. Any unrecognized patterns following '$' are treated verbatim, however are reserved for future use. You are thus advised to avoid '$' or escape it as "$$". For example, set it to "${CONNECTION}-${BOOT}-${DEVICE}" to create a unique id for this connection that changes with every reboot and differs depending on the interface where the profile activates. If the value is unset, a global connection default is consulted. If the value is still unset, the default is similar to "${CONNECTION}" and uses a unique, fixed ID for the connection." /> <property name="timestamp" name_upper="TIMESTAMP" type="uint64" default="0" description="The time, in seconds since the Unix Epoch, that the connection was last _successfully_ fully activated. NetworkManager updates the connection timestamp periodically when the connection is active to ensure that an active connection has the latest timestamp. The property is only meant for reading (changes to this property will not be preserved)." /> <property name="type" name_upper="TYPE" type="string" description="Base type of the connection. For hardware-dependent connections, should contain the setting name of the hardware-type specific setting (ie, "802-3-ethernet" or "802-11-wireless" or "bluetooth", etc), and for non-hardware dependent connections like VPN or otherwise, should contain the setting name of that setting type (ie, "vpn" or "bridge", etc)." /> <property name="uuid" name_upper="UUID" type="string" description="A universally unique identifier for the connection, for example generated with libuuid. It should be assigned when the connection is created, and never changed as long as the connection still applies to the same network. For example, it should not be changed when the "id" property or NMSettingIP4Config changes, but might need to be re-created when the Wi-Fi SSID, mobile broadband network provider, or "type" property changes. The UUID must be in the format "2815492f-7e56-435e-b2e9-246bd7cdc664" (ie, contains only hexadecimal characters and "-")." /> @@ -170,14 +170,14 @@ <setting name="ipv4" description="IPv4 Settings" name_upper="IP4_CONFIG" > <property name="addresses" name_upper="ADDRESSES" type="array of array of uint32" default="[]" description="Array of IP addresses." /> <property name="dad-timeout" name_upper="DAD_TIMEOUT" type="int32" default="-1" description="Timeout in milliseconds used to check for the presence of duplicate IP addresses on the network. If an address conflict is detected, the activation will fail. A zero value means that no duplicate address detection is performed, -1 means the default value (either configuration ipvx.dad-timeout override or zero). A value greater than zero is a timeout in milliseconds. The property is currently implemented only for IPv4." /> - <property name="dhcp-client-id" name_upper="DHCP_CLIENT_ID" type="string" description="A string sent to the DHCP server to identify the local machine which the DHCP server may use to customize the DHCP lease and options. When the property is a hex string ('aa:bb:cc') it is interpreted as a binary client ID, in which case the first byte is assumed to be the 'type' field as per RFC 2132 section 9.14 and the remaining bytes may be an hardware address (e.g. '01:xx:xx:xx:xx:xx:xx' where 1 is the Ethernet ARP type and the rest is a MAC address). If the property is not a hex string it is considered as a non-hardware-address client ID and the 'type' field is set to 0. The special values "mac" and "perm-mac" are supported, which use the current or permanent MAC address of the device to generate a client identifier with type ethernet type (01). Currently, these options only work for ethernet type of links. The special value "stable" is supported to generate a type 0 client identifier based on the stable-id (see connection.stable-id). If unset, a globally configured default is used. If still unset, the client-id from the last lease is reused." /> + <property name="dhcp-client-id" name_upper="DHCP_CLIENT_ID" type="string" description="A string sent to the DHCP server to identify the local machine which the DHCP server may use to customize the DHCP lease and options. When the property is a hex string ('aa:bb:cc') it is interpreted as a binary client ID, in which case the first byte is assumed to be the 'type' field as per RFC 2132 section 9.14 and the remaining bytes may be an hardware address (e.g. '01:xx:xx:xx:xx:xx:xx' where 1 is the Ethernet ARP type and the rest is a MAC address). If the property is not a hex string it is considered as a non-hardware-address client ID and the 'type' field is set to 0. The special values "mac" and "perm-mac" are supported, which use the current or permanent MAC address of the device to generate a client identifier with type ethernet type (01). Currently, these options only work for ethernet type of links. The special value "stable" is supported to generate a type 0 client identifier based on the stable-id (see connection.stable-id) and a per-host key. If unset, a globally configured default is used. If still unset, the client-id from the last lease is reused." /> <property name="dhcp-fqdn" name_upper="DHCP_FQDN" type="string" description="If the "dhcp-send-hostname" property is TRUE, then the specified FQDN will be sent to the DHCP server when acquiring a lease. This property and "dhcp-hostname" are mutually exclusive and cannot be set at the same time." /> <property name="dhcp-hostname" name_upper="DHCP_HOSTNAME" type="string" description="If the "dhcp-send-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and "dhcp-fqdn" are mutually exclusive and cannot be set at the same time." /> <property name="dhcp-send-hostname" name_upper="DHCP_SEND_HOSTNAME" type="boolean" default="TRUE" description="If TRUE, a hostname is sent to the DHCP server when acquiring a lease. Some DHCP servers use this hostname to update DNS databases, essentially providing a static hostname for the computer. If the "dhcp-hostname" property is NULL and this property is TRUE, the current persistent hostname of the computer is sent." /> <property name="dhcp-timeout" name_upper="DHCP_TIMEOUT" type="int32" default="0" description="A timeout for a DHCP transaction in seconds." /> <property name="dns" name_upper="DNS" type="array of uint32" default="[]" description="Array of IP addresses of DNS servers." /> <property name="dns-options" name_upper="DNS_OPTIONS" type="array of string" default="[]" description="Array of DNS options as described in man 5 resolv.conf. NULL means that the options are unset and left at the default. In this case NetworkManager will use default options. This is distinct from an empty list of properties." /> - <property name="dns-priority" name_upper="DNS_PRIORITY" type="int32" default="0" description="Intra-connection DNS priority. The relative priority to be used when determining the order of DNS servers in resolv.conf. A lower value means that servers will be on top of the file. Zero selects the default value, which is 50 for VPNs and 100 for other connections. Note that the priority is to order DNS settings for multiple active connections. It does not disambiguate multiple DNS servers within the same connection profile. For that, just specify the DNS servers in the desired order. When multiple devices have configurations with the same priority, the one with an active default route will be preferred. Note that when using dns=dnsmasq the order is meaningless since dnsmasq forwards queries to all known servers at the same time. Negative values have the special effect of excluding other configurations with a greater priority value; so in presence of at least a negative priority, only DNS servers from connections with the lowest priority value will be used." /> + <property name="dns-priority" name_upper="DNS_PRIORITY" type="int32" default="0" description="DNS servers priority. The relative priority for DNS servers specified by this setting. A lower value is better (higher priority). Zero selects the default value, which is 50 for VPNs and 100 for other connections. Note that the priority is to order DNS settings for multiple active connections. It does not disambiguate multiple DNS servers within the same connection profile. When using dns=default, servers with higher priority will be on top of resolv.conf. To prioritize a given server over another one within the same connection, just specify them in the desired order. When multiple devices have configurations with the same priority, the one with an active default route will be preferred. Negative values have the special effect of excluding other configurations with a greater priority value; so in presence of at least a negative priority, only DNS servers from connections with the lowest priority value will be used. When using a DNS resolver that supports split-DNS as dns=dnsmasq or dns=systemd-resolved, each connection is used to query domains in its search list. Queries for domains not present in any search list are routed through connections having the '~.' special wildcard domain, which is added automatically to connections with the default route (or can be added manually). When multiple connections specify the same domain, the one with the highest priority (lowest numerical value) wins. If a connection specifies a domain which is subdomain of another domain with a negative DNS priority value, the subdomain is ignored." /> <property name="dns-search" name_upper="DNS_SEARCH" type="array of string" default="[]" description="Array of DNS search domains. Domains starting with a tilde ('~') are considered 'routing' domains and are used only to decide the interface over which a query must be forwarded; they are not used to complete unqualified host names." /> <property name="gateway" name_upper="GATEWAY" type="string" description="The gateway associated with this configuration. This is only meaningful if "addresses" is also set." /> <property name="ignore-auto-dns" name_upper="IGNORE_AUTO_DNS" type="boolean" default="FALSE" description="When "method" is set to "auto" and this property to TRUE, automatically configured nameservers and search domains are ignored and only nameservers and search domains specified in the "dns" and "dns-search" properties, if any, are used." /> @@ -199,7 +199,7 @@ <property name="dhcp-timeout" name_upper="DHCP_TIMEOUT" type="int32" default="0" description="A timeout for a DHCP transaction in seconds." /> <property name="dns" name_upper="DNS" type="array of byte array" default="[]" description="Array of IP addresses of DNS servers." /> <property name="dns-options" name_upper="DNS_OPTIONS" type="array of string" default="[]" description="Array of DNS options as described in man 5 resolv.conf. NULL means that the options are unset and left at the default. In this case NetworkManager will use default options. This is distinct from an empty list of properties." /> - <property name="dns-priority" name_upper="DNS_PRIORITY" type="int32" default="0" description="Intra-connection DNS priority. The relative priority to be used when determining the order of DNS servers in resolv.conf. A lower value means that servers will be on top of the file. Zero selects the default value, which is 50 for VPNs and 100 for other connections. Note that the priority is to order DNS settings for multiple active connections. It does not disambiguate multiple DNS servers within the same connection profile. For that, just specify the DNS servers in the desired order. When multiple devices have configurations with the same priority, the one with an active default route will be preferred. Note that when using dns=dnsmasq the order is meaningless since dnsmasq forwards queries to all known servers at the same time. Negative values have the special effect of excluding other configurations with a greater priority value; so in presence of at least a negative priority, only DNS servers from connections with the lowest priority value will be used." /> + <property name="dns-priority" name_upper="DNS_PRIORITY" type="int32" default="0" description="DNS servers priority. The relative priority for DNS servers specified by this setting. A lower value is better (higher priority). Zero selects the default value, which is 50 for VPNs and 100 for other connections. Note that the priority is to order DNS settings for multiple active connections. It does not disambiguate multiple DNS servers within the same connection profile. When using dns=default, servers with higher priority will be on top of resolv.conf. To prioritize a given server over another one within the same connection, just specify them in the desired order. When multiple devices have configurations with the same priority, the one with an active default route will be preferred. Negative values have the special effect of excluding other configurations with a greater priority value; so in presence of at least a negative priority, only DNS servers from connections with the lowest priority value will be used. When using a DNS resolver that supports split-DNS as dns=dnsmasq or dns=systemd-resolved, each connection is used to query domains in its search list. Queries for domains not present in any search list are routed through connections having the '~.' special wildcard domain, which is added automatically to connections with the default route (or can be added manually). When multiple connections specify the same domain, the one with the highest priority (lowest numerical value) wins. If a connection specifies a domain which is subdomain of another domain with a negative DNS priority value, the subdomain is ignored." /> <property name="dns-search" name_upper="DNS_SEARCH" type="array of string" default="[]" description="Array of DNS search domains. Domains starting with a tilde ('~') are considered 'routing' domains and are used only to decide the interface over which a query must be forwarded; they are not used to complete unqualified host names." /> <property name="gateway" name_upper="GATEWAY" type="string" description="The gateway associated with this configuration. This is only meaningful if "addresses" is also set." /> <property name="ignore-auto-dns" name_upper="IGNORE_AUTO_DNS" type="boolean" default="FALSE" description="When "method" is set to "auto" and this property to TRUE, automatically configured nameservers and search domains are ignored and only nameservers and search domains specified in the "dns" and "dns-search" properties, if any, are used." /> @@ -433,7 +433,7 @@ <property name="channel" name_upper="CHANNEL" type="uint32" default="0" description="Wireless channel to use for the Wi-Fi connection. The device will only join (or create for Ad-Hoc networks) a Wi-Fi network on the specified channel. Because channel numbers overlap between bands, this property also requires the "band" property to be set." /> <property name="cloned-mac-address" name_upper="CLONED_MAC_ADDRESS" type="byte array" description="If specified, request that the device use this MAC address instead. This is known as MAC cloning or spoofing. Beside explicitly specifying a MAC address, the special values "preserve", "permanent", "random" and "stable" are supported. "preserve" means not to touch the MAC address on activation. "permanent" means to use the permanent hardware address of the device. "random" creates a random MAC address on each connect. "stable" creates a hashed MAC address based on connection.stable-id and a machine dependent key. If unspecified, the value can be overwritten via global defaults, see manual of NetworkManager.conf. If still unspecified, it defaults to "preserve" (older versions of NetworkManager may use a different default value). On D-Bus, this field is expressed as "assigned-mac-address" or the deprecated "cloned-mac-address"." /> <property name="generate-mac-address-mask" name_upper="GENERATE_MAC_ADDRESS_MASK" type="string" description="With "cloned-mac-address" setting "random" or "stable", by default all bits of the MAC address are scrambled and a locally-administered, unicast MAC address is created. This property allows to specify that certain bits are fixed. Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address. If the property is NULL, it is eligible to be overwritten by a default connection setting. If the value is still NULL or an empty string, the default is to create a locally-administered, unicast MAC address. If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC address of the device, while the unset bits are subject to randomization. Setting "FE:FF:FF:00:00:00" means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the "random" or "stable" algorithm. If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits that shall not be randomized. For example, a value of "FE:FF:FF:00:00:00 68:F7:28:00:00:00" will set the OUI of the MAC address to 68:F7:28, while the lower bits are randomized. A value of "02:00:00:00:00:00 00:00:00:00:00:00" will create a fully scrambled globally-administered, burned-in MAC address. If the value contains more than one additional MAC addresses, one of them is chosen randomly. For example, "02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00" will create a fully scrambled MAC address, randomly locally or globally administered." /> - <property name="hidden" name_upper="HIDDEN" type="boolean" default="FALSE" description="If TRUE, indicates this network is a non-broadcasting network that hides its SSID. In this case various workarounds may take place, such as probe-scanning the SSID for more reliable network discovery. However, these workarounds expose inherent insecurities with hidden SSID networks, and thus hidden SSID networks should be used with caution." /> + <property name="hidden" name_upper="HIDDEN" type="boolean" default="FALSE" description="If TRUE, indicates this network is a non-broadcasting network that hides its SSID. In this case various workarounds may take place, such as probe-scanning the SSID for more reliable network discovery. However, these workarounds expose inherent insecurities with hidden SSID networks, and thus hidden SSID networks should be used with caution. Note that marking the network as hidden may be a privacy issue for you, as the explicit probe-scans may be distinctly recognizable on the air." /> <property name="mac-address" name_upper="MAC_ADDRESS" type="byte array" description="If specified, this connection will only apply to the Wi-Fi device whose permanent MAC address matches. This property does not change the MAC address of the device (i.e. MAC spoofing)." /> <property name="mac-address-blacklist" name_upper="MAC_ADDRESS_BLACKLIST" type="array of string" default="[]" description="A list of permanent MAC addresses of Wi-Fi devices to which this connection should never apply. Each MAC address should be given in the standard hex-digits-and-colons notation (eg "00:11:22:33:44:55")." /> <property name="mac-address-randomization" name_upper="MAC_ADDRESS_RANDOMIZATION" type="uint32" default="0" description="One of NM_SETTING_MAC_RANDOMIZATION_DEFAULT (0) (never randomize unless the user has set a global default to randomize and the supplicant supports randomization), NM_SETTING_MAC_RANDOMIZATION_NEVER (1) (never randomize the MAC address), or NM_SETTING_MAC_RANDOMIZATION_ALWAYS (2) (always randomize the MAC address). This property is deprecated for 'cloned-mac-address'. Deprecated: 1" /> diff --git a/libnm/nm-remote-connection.h b/libnm/nm-remote-connection.h index a729f904..d5b6a8c4 100644 --- a/libnm/nm-remote-connection.h +++ b/libnm/nm-remote-connection.h @@ -37,7 +37,6 @@ G_BEGIN_DECLS #define NM_IS_REMOTE_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_REMOTE_CONNECTION)) #define NM_REMOTE_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_REMOTE_CONNECTION, NMRemoteConnectionClass)) - /* Properties */ #define NM_REMOTE_CONNECTION_DBUS_CONNECTION "dbus-connection" #define NM_REMOTE_CONNECTION_PATH "path" diff --git a/libnm/nm-remote-settings.c b/libnm/nm-remote-settings.c index 2339e872..f2b26215 100644 --- a/libnm/nm-remote-settings.c +++ b/libnm/nm-remote-settings.c @@ -533,13 +533,12 @@ nm_remote_settings_save_hostname (NMRemoteSettings *settings, NMRemoteSettingsPrivate *priv; gboolean ret; - g_return_val_if_fail (NM_IS_REMOTE_SETTINGS (settings), FALSE); priv = NM_REMOTE_SETTINGS_GET_PRIVATE (settings); ret = nmdbus_settings_call_save_hostname_sync (priv->proxy, - hostname ? hostname : "", + hostname ?: "", cancellable, error); if (error && *error) g_dbus_error_strip_remote_error (*error); @@ -584,7 +583,7 @@ nm_remote_settings_save_hostname_async (NMRemoteSettings *settings, g_simple_async_result_set_check_cancellable (simple, cancellable); nmdbus_settings_call_save_hostname (priv->proxy, - hostname ? hostname : "", + hostname ?: "", cancellable, save_hostname_cb, simple); } diff --git a/libnm/nm-secret-agent-old.c b/libnm/nm-secret-agent-old.c index 74914512..1b9e8915 100644 --- a/libnm/nm-secret-agent-old.c +++ b/libnm/nm-secret-agent-old.c @@ -224,7 +224,7 @@ verify_sender (NMSecretAgentOld *self, NM_SECRET_AGENT_ERROR, NM_SECRET_AGENT_ERROR_PERMISSION_DENIED, "Failed to request unix user: (%s) %s.", - remote_error ? remote_error : "", + remote_error ?: "", local->message); g_free (remote_error); g_error_free (local); diff --git a/libnm/nm-settings-docs.xml b/libnm/nm-settings-docs.xml index 4a505594..5334b658 100644 --- a/libnm/nm-settings-docs.xml +++ b/libnm/nm-settings-docs.xml @@ -21,7 +21,7 @@ <property name="read-only" name_upper="READ_ONLY" type="boolean" default="FALSE" description="FALSE if the connection can be modified using the provided settings service's D-Bus interface with the right privileges, or TRUE if the connection is read-only and cannot be modified." /> <property name="secondaries" name_upper="SECONDARIES" type="array of string" default="[]" description="List of connection UUIDs that should be activated when the base connection itself is activated. Currently only VPN connections are supported." /> <property name="slave-type" name_upper="SLAVE_TYPE" type="string" description="Setting name of the device type of this slave's master connection (eg, "bond"), or NULL if this connection is not a slave." /> - <property name="stable-id" name_upper="STABLE_ID" type="string" description="Token to generate stable IDs for the connection. The stable-id is used for generating IPv6 stable private addresses with ipv6.addr-gen-mode=stable-privacy. It is also used to seed the generated cloned MAC address for ethernet.cloned-mac-address=stable and wifi.cloned-mac-address=stable. It is also used as DHCP client identifier with ipv4.dhcp-client-id=stable. Note that also the interface name of the activating connection and a per-host secret key is included into the address generation so that the same stable-id on different hosts/devices yields different addresses. If the value is unset, an ID unique for the connection is used. Specifying a stable-id allows multiple connections to generate the same addresses. Another use is to generate IDs at runtime via dynamic substitutions. The '$' character is treated special to perform dynamic substitutions at runtime. Currently supported are "${CONNECTION}", "${BOOT}", "${RANDOM}". These effectively create unique IDs per-connection, per-boot, or every time. Any unrecognized patterns following '$' are treated verbatim, however are reserved for future use. You are thus advised to avoid '$' or escape it as "$$". For example, set it to "${CONNECTION}/${BOOT}" to create a unique id for this connection that changes with every reboot. Note that two connections only use the same effective id if their stable-id is also identical before performing dynamic substitutions." /> + <property name="stable-id" name_upper="STABLE_ID" type="string" description="This represents the identity of the connection used for various purposes. It allows to configure multiple profiles to share the identity. Also, the stable-id can contain placeholders that are substituted dynamically and deterministically depending on the context. The stable-id is used for generating IPv6 stable private addresses with ipv6.addr-gen-mode=stable-privacy. It is also used to seed the generated cloned MAC address for ethernet.cloned-mac-address=stable and wifi.cloned-mac-address=stable. It is also used as DHCP client identifier with ipv4.dhcp-client-id=stable. Note that depending on the context where it is used, other parameters are also seeded into the generation algorithm. For example, a per-host key is commonly also included, so that different systems end up generating different IDs. Or with ipv6.addr-gen-mode=stable-privacy, also the device's name is included, so that different interfaces yield different addresses. The '$' character is treated special to perform dynamic substitutions at runtime. Currently supported are "${CONNECTION}", "${DEVICE}", "${BOOT}", "${RANDOM}". These effectively create unique IDs per-connection, per-device, per-boot, or every time. Note that "${DEVICE}" corresponds the the interface name of the device. Any unrecognized patterns following '$' are treated verbatim, however are reserved for future use. You are thus advised to avoid '$' or escape it as "$$". For example, set it to "${CONNECTION}-${BOOT}-${DEVICE}" to create a unique id for this connection that changes with every reboot and differs depending on the interface where the profile activates. If the value is unset, a global connection default is consulted. If the value is still unset, the default is similar to "${CONNECTION}" and uses a unique, fixed ID for the connection." /> <property name="timestamp" name_upper="TIMESTAMP" type="uint64" default="0" description="The time, in seconds since the Unix Epoch, that the connection was last _successfully_ fully activated. NetworkManager updates the connection timestamp periodically when the connection is active to ensure that an active connection has the latest timestamp. The property is only meant for reading (changes to this property will not be preserved)." /> <property name="type" name_upper="TYPE" type="string" description="Base type of the connection. For hardware-dependent connections, should contain the setting name of the hardware-type specific setting (ie, "802-3-ethernet" or "802-11-wireless" or "bluetooth", etc), and for non-hardware dependent connections like VPN or otherwise, should contain the setting name of that setting type (ie, "vpn" or "bridge", etc)." /> <property name="uuid" name_upper="UUID" type="string" description="A universally unique identifier for the connection, for example generated with libuuid. It should be assigned when the connection is created, and never changed as long as the connection still applies to the same network. For example, it should not be changed when the "id" property or NMSettingIP4Config changes, but might need to be re-created when the Wi-Fi SSID, mobile broadband network provider, or "type" property changes. The UUID must be in the format "2815492f-7e56-435e-b2e9-246bd7cdc664" (ie, contains only hexadecimal characters and "-")." /> @@ -173,14 +173,14 @@ <property name="address-data" name_upper="ADDRESS_DATA" type="array of vardict" description="Array of IPv4 addresses. Each address dictionary contains at least 'address' and 'prefix' entries, containing the IP address as a string, and the prefix length as a uint32. Additional attributes may also exist on some addresses." /> <property name="addresses" name_upper="ADDRESSES" type="array of array of uint32" default="[]" description="Deprecated in favor of the 'address-data' and 'gateway' properties, but this can be used for backward-compatibility with older daemons. Note that if you send this property the daemon will ignore 'address-data' and 'gateway'. Array of IPv4 address structures. Each IPv4 address structure is composed of 3 32-bit values; the first being the IPv4 address (network byte order), the second the prefix (1 - 32), and last the IPv4 gateway (network byte order). The gateway may be left as 0 if no gateway exists for that subnet." /> <property name="dad-timeout" name_upper="DAD_TIMEOUT" type="int32" default="-1" description="Timeout in milliseconds used to check for the presence of duplicate IP addresses on the network. If an address conflict is detected, the activation will fail. A zero value means that no duplicate address detection is performed, -1 means the default value (either configuration ipvx.dad-timeout override or zero). A value greater than zero is a timeout in milliseconds. The property is currently implemented only for IPv4." /> - <property name="dhcp-client-id" name_upper="DHCP_CLIENT_ID" type="string" description="A string sent to the DHCP server to identify the local machine which the DHCP server may use to customize the DHCP lease and options. When the property is a hex string ('aa:bb:cc') it is interpreted as a binary client ID, in which case the first byte is assumed to be the 'type' field as per RFC 2132 section 9.14 and the remaining bytes may be an hardware address (e.g. '01:xx:xx:xx:xx:xx:xx' where 1 is the Ethernet ARP type and the rest is a MAC address). If the property is not a hex string it is considered as a non-hardware-address client ID and the 'type' field is set to 0. The special values "mac" and "perm-mac" are supported, which use the current or permanent MAC address of the device to generate a client identifier with type ethernet type (01). Currently, these options only work for ethernet type of links. The special value "stable" is supported to generate a type 0 client identifier based on the stable-id (see connection.stable-id). If unset, a globally configured default is used. If still unset, the client-id from the last lease is reused." /> + <property name="dhcp-client-id" name_upper="DHCP_CLIENT_ID" type="string" description="A string sent to the DHCP server to identify the local machine which the DHCP server may use to customize the DHCP lease and options. When the property is a hex string ('aa:bb:cc') it is interpreted as a binary client ID, in which case the first byte is assumed to be the 'type' field as per RFC 2132 section 9.14 and the remaining bytes may be an hardware address (e.g. '01:xx:xx:xx:xx:xx:xx' where 1 is the Ethernet ARP type and the rest is a MAC address). If the property is not a hex string it is considered as a non-hardware-address client ID and the 'type' field is set to 0. The special values "mac" and "perm-mac" are supported, which use the current or permanent MAC address of the device to generate a client identifier with type ethernet type (01). Currently, these options only work for ethernet type of links. The special value "stable" is supported to generate a type 0 client identifier based on the stable-id (see connection.stable-id) and a per-host key. If unset, a globally configured default is used. If still unset, the client-id from the last lease is reused." /> <property name="dhcp-fqdn" name_upper="DHCP_FQDN" type="string" description="If the "dhcp-send-hostname" property is TRUE, then the specified FQDN will be sent to the DHCP server when acquiring a lease. This property and "dhcp-hostname" are mutually exclusive and cannot be set at the same time." /> <property name="dhcp-hostname" name_upper="DHCP_HOSTNAME" type="string" description="If the "dhcp-send-hostname" property is TRUE, then the specified name will be sent to the DHCP server when acquiring a lease. This property and "dhcp-fqdn" are mutually exclusive and cannot be set at the same time." /> <property name="dhcp-send-hostname" name_upper="DHCP_SEND_HOSTNAME" type="boolean" default="TRUE" description="If TRUE, a hostname is sent to the DHCP server when acquiring a lease. Some DHCP servers use this hostname to update DNS databases, essentially providing a static hostname for the computer. If the "dhcp-hostname" property is NULL and this property is TRUE, the current persistent hostname of the computer is sent." /> <property name="dhcp-timeout" name_upper="DHCP_TIMEOUT" type="int32" default="0" description="A timeout for a DHCP transaction in seconds." /> <property name="dns" name_upper="DNS" type="array of uint32" default="[]" description="Array of IP addresses of DNS servers (as network-byte-order integers)" /> <property name="dns-options" name_upper="DNS_OPTIONS" type="array of string" default="[]" description="Array of DNS options as described in man 5 resolv.conf. NULL means that the options are unset and left at the default. In this case NetworkManager will use default options. This is distinct from an empty list of properties." /> - <property name="dns-priority" name_upper="DNS_PRIORITY" type="int32" default="0" description="Intra-connection DNS priority. The relative priority to be used when determining the order of DNS servers in resolv.conf. A lower value means that servers will be on top of the file. Zero selects the default value, which is 50 for VPNs and 100 for other connections. Note that the priority is to order DNS settings for multiple active connections. It does not disambiguate multiple DNS servers within the same connection profile. For that, just specify the DNS servers in the desired order. When multiple devices have configurations with the same priority, the one with an active default route will be preferred. Note that when using dns=dnsmasq the order is meaningless since dnsmasq forwards queries to all known servers at the same time. Negative values have the special effect of excluding other configurations with a greater priority value; so in presence of at least a negative priority, only DNS servers from connections with the lowest priority value will be used." /> + <property name="dns-priority" name_upper="DNS_PRIORITY" type="int32" default="0" description="DNS servers priority. The relative priority for DNS servers specified by this setting. A lower value is better (higher priority). Zero selects the default value, which is 50 for VPNs and 100 for other connections. Note that the priority is to order DNS settings for multiple active connections. It does not disambiguate multiple DNS servers within the same connection profile. When using dns=default, servers with higher priority will be on top of resolv.conf. To prioritize a given server over another one within the same connection, just specify them in the desired order. When multiple devices have configurations with the same priority, the one with an active default route will be preferred. Negative values have the special effect of excluding other configurations with a greater priority value; so in presence of at least a negative priority, only DNS servers from connections with the lowest priority value will be used. When using a DNS resolver that supports split-DNS as dns=dnsmasq or dns=systemd-resolved, each connection is used to query domains in its search list. Queries for domains not present in any search list are routed through connections having the '~.' special wildcard domain, which is added automatically to connections with the default route (or can be added manually). When multiple connections specify the same domain, the one with the highest priority (lowest numerical value) wins. If a connection specifies a domain which is subdomain of another domain with a negative DNS priority value, the subdomain is ignored." /> <property name="dns-search" name_upper="DNS_SEARCH" type="array of string" default="[]" description="Array of DNS search domains. Domains starting with a tilde ('~') are considered 'routing' domains and are used only to decide the interface over which a query must be forwarded; they are not used to complete unqualified host names." /> <property name="gateway" name_upper="GATEWAY" type="string" description="The gateway associated with this configuration. This is only meaningful if "addresses" is also set." /> <property name="ignore-auto-dns" name_upper="IGNORE_AUTO_DNS" type="boolean" default="FALSE" description="When "method" is set to "auto" and this property to TRUE, automatically configured nameservers and search domains are ignored and only nameservers and search domains specified in the "dns" and "dns-search" properties, if any, are used." /> @@ -204,7 +204,7 @@ <property name="dhcp-timeout" name_upper="DHCP_TIMEOUT" type="int32" default="0" description="A timeout for a DHCP transaction in seconds." /> <property name="dns" name_upper="DNS" type="array of byte array" default="[]" description="Array of IP addresses of DNS servers (in network byte order)" /> <property name="dns-options" name_upper="DNS_OPTIONS" type="array of string" default="[]" description="Array of DNS options as described in man 5 resolv.conf. NULL means that the options are unset and left at the default. In this case NetworkManager will use default options. This is distinct from an empty list of properties." /> - <property name="dns-priority" name_upper="DNS_PRIORITY" type="int32" default="0" description="Intra-connection DNS priority. The relative priority to be used when determining the order of DNS servers in resolv.conf. A lower value means that servers will be on top of the file. Zero selects the default value, which is 50 for VPNs and 100 for other connections. Note that the priority is to order DNS settings for multiple active connections. It does not disambiguate multiple DNS servers within the same connection profile. For that, just specify the DNS servers in the desired order. When multiple devices have configurations with the same priority, the one with an active default route will be preferred. Note that when using dns=dnsmasq the order is meaningless since dnsmasq forwards queries to all known servers at the same time. Negative values have the special effect of excluding other configurations with a greater priority value; so in presence of at least a negative priority, only DNS servers from connections with the lowest priority value will be used." /> + <property name="dns-priority" name_upper="DNS_PRIORITY" type="int32" default="0" description="DNS servers priority. The relative priority for DNS servers specified by this setting. A lower value is better (higher priority). Zero selects the default value, which is 50 for VPNs and 100 for other connections. Note that the priority is to order DNS settings for multiple active connections. It does not disambiguate multiple DNS servers within the same connection profile. When using dns=default, servers with higher priority will be on top of resolv.conf. To prioritize a given server over another one within the same connection, just specify them in the desired order. When multiple devices have configurations with the same priority, the one with an active default route will be preferred. Negative values have the special effect of excluding other configurations with a greater priority value; so in presence of at least a negative priority, only DNS servers from connections with the lowest priority value will be used. When using a DNS resolver that supports split-DNS as dns=dnsmasq or dns=systemd-resolved, each connection is used to query domains in its search list. Queries for domains not present in any search list are routed through connections having the '~.' special wildcard domain, which is added automatically to connections with the default route (or can be added manually). When multiple connections specify the same domain, the one with the highest priority (lowest numerical value) wins. If a connection specifies a domain which is subdomain of another domain with a negative DNS priority value, the subdomain is ignored." /> <property name="dns-search" name_upper="DNS_SEARCH" type="array of string" default="[]" description="Array of DNS search domains. Domains starting with a tilde ('~') are considered 'routing' domains and are used only to decide the interface over which a query must be forwarded; they are not used to complete unqualified host names." /> <property name="gateway" name_upper="GATEWAY" type="string" description="The gateway associated with this configuration. This is only meaningful if "addresses" is also set." /> <property name="ignore-auto-dns" name_upper="IGNORE_AUTO_DNS" type="boolean" default="FALSE" description="When "method" is set to "auto" and this property to TRUE, automatically configured nameservers and search domains are ignored and only nameservers and search domains specified in the "dns" and "dns-search" properties, if any, are used." /> @@ -443,7 +443,7 @@ <property name="channel" name_upper="CHANNEL" type="uint32" default="0" description="Wireless channel to use for the Wi-Fi connection. The device will only join (or create for Ad-Hoc networks) a Wi-Fi network on the specified channel. Because channel numbers overlap between bands, this property also requires the "band" property to be set." /> <property name="cloned-mac-address" name_upper="CLONED_MAC_ADDRESS" type="byte array" description="This D-Bus field is deprecated in favor of "assigned-mac-address" which is more flexible and allows specifying special variants like "random". For libnm and nmcli, this field is called "cloned-mac-address"." /> <property name="generate-mac-address-mask" name_upper="GENERATE_MAC_ADDRESS_MASK" type="string" description="With "cloned-mac-address" setting "random" or "stable", by default all bits of the MAC address are scrambled and a locally-administered, unicast MAC address is created. This property allows to specify that certain bits are fixed. Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address. If the property is NULL, it is eligible to be overwritten by a default connection setting. If the value is still NULL or an empty string, the default is to create a locally-administered, unicast MAC address. If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC address of the device, while the unset bits are subject to randomization. Setting "FE:FF:FF:00:00:00" means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the "random" or "stable" algorithm. If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits that shall not be randomized. For example, a value of "FE:FF:FF:00:00:00 68:F7:28:00:00:00" will set the OUI of the MAC address to 68:F7:28, while the lower bits are randomized. A value of "02:00:00:00:00:00 00:00:00:00:00:00" will create a fully scrambled globally-administered, burned-in MAC address. If the value contains more than one additional MAC addresses, one of them is chosen randomly. For example, "02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00" will create a fully scrambled MAC address, randomly locally or globally administered." /> - <property name="hidden" name_upper="HIDDEN" type="boolean" default="FALSE" description="If TRUE, indicates this network is a non-broadcasting network that hides its SSID. In this case various workarounds may take place, such as probe-scanning the SSID for more reliable network discovery. However, these workarounds expose inherent insecurities with hidden SSID networks, and thus hidden SSID networks should be used with caution." /> + <property name="hidden" name_upper="HIDDEN" type="boolean" default="FALSE" description="If TRUE, indicates this network is a non-broadcasting network that hides its SSID. In this case various workarounds may take place, such as probe-scanning the SSID for more reliable network discovery. However, these workarounds expose inherent insecurities with hidden SSID networks, and thus hidden SSID networks should be used with caution. Note that marking the network as hidden may be a privacy issue for you, as the explicit probe-scans may be distinctly recognizable on the air." /> <property name="mac-address" name_upper="MAC_ADDRESS" type="byte array" description="If specified, this connection will only apply to the Wi-Fi device whose permanent MAC address matches. This property does not change the MAC address of the device (i.e. MAC spoofing)." /> <property name="mac-address-blacklist" name_upper="MAC_ADDRESS_BLACKLIST" type="array of string" default="[]" description="A list of permanent MAC addresses of Wi-Fi devices to which this connection should never apply. Each MAC address should be given in the standard hex-digits-and-colons notation (eg "00:11:22:33:44:55")." /> <property name="mac-address-randomization" name_upper="MAC_ADDRESS_RANDOMIZATION" type="uint32" default="0" description="One of NM_SETTING_MAC_RANDOMIZATION_DEFAULT (0) (never randomize unless the user has set a global default to randomize and the supplicant supports randomization), NM_SETTING_MAC_RANDOMIZATION_NEVER (1) (never randomize the MAC address), or NM_SETTING_MAC_RANDOMIZATION_ALWAYS (2) (always randomize the MAC address). This property is deprecated for 'cloned-mac-address'. Deprecated: 1" /> diff --git a/libnm/nm-vpn-connection.c b/libnm/nm-vpn-connection.c index 636c3950..5a3c4e56 100644 --- a/libnm/nm-vpn-connection.c +++ b/libnm/nm-vpn-connection.c @@ -59,7 +59,6 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; - /** * nm_vpn_connection_get_banner: * @vpn: a #NMVpnConnection diff --git a/libnm/nm-vpn-plugin-old.c b/libnm/nm-vpn-plugin-old.c index c5fc615e..bfafc7b7 100644 --- a/libnm/nm-vpn-plugin-old.c +++ b/libnm/nm-vpn-plugin-old.c @@ -94,7 +94,6 @@ enum { static GSList *active_plugins = NULL; - static void nm_vpn_plugin_old_set_connection (NMVpnPluginOld *plugin, GDBusConnection *connection) diff --git a/libnm/nm-vpn-service-plugin.c b/libnm/nm-vpn-service-plugin.c index 901ffa98..da4c2446 100644 --- a/libnm/nm-vpn-service-plugin.c +++ b/libnm/nm-vpn-service-plugin.c @@ -96,7 +96,6 @@ enum { static GSList *active_plugins = NULL; - static void nm_vpn_service_plugin_set_connection (NMVpnServicePlugin *plugin, GDBusConnection *connection) @@ -882,7 +881,6 @@ nm_vpn_service_plugin_get_secret_flags (GHashTable *data, if (!secret_name || !*secret_name) g_return_val_if_reached (FALSE); - s = g_hash_table_lookup (data, nm_construct_name_a ("%s-flags", secret_name, &flag_name_free)); if (!s) diff --git a/libnm/tests/meson.build b/libnm/tests/meson.build index c47814b3..e2b88273 100644 --- a/libnm/tests/meson.build +++ b/libnm/tests/meson.build @@ -1,28 +1,28 @@ test_units = [ - ['test-general', shared_utils, [libnm_utils]], - ['test-nm-client', shared_test_utils, []], - ['test-remote-settings-client', shared_test_utils, []], - ['test-secret-agent', shared_test_utils, []] -] - -deps = [ - libnm_dep, - nm_core_dep + ['test-general', [libnm_utils, libnm_core]], + ['test-nm-client', []], + ['test-remote-settings-client', []], + ['test-secret-agent', []], ] cflags = [ '-DNETWORKMANAGER_COMPILATION_TEST', '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM', - '-DTEST_NM_SERVICE="@0@"'.format(join_paths(meson.source_root(), 'tools', 'test-networkmanager-service.py')) -] +] + nm_build_cflags foreach test_unit: test_units exe = executable( 'libnm-' + test_unit[0], - [test_unit[0] + '.c'] + test_unit[1], - dependencies: deps, + [ + test_unit[0] + '.c', + shared_nm_test_utils_impl_c, + ], + dependencies: [ + libnm_dep, + nm_core_dep, + ], c_args: cflags, - link_with: test_unit[2] + link_with: test_unit[1] ) test( @@ -35,7 +35,7 @@ endforeach # just test, that we can build "nm-vpn-plugin-utils.c" libnm_vpn_plugin_utils_test = static_library( 'nm-vpn-plugin-utils-test', - sources: shared_vpn_plugin_utils + [libnm_enum[1]], + sources: shared_nm_utils_nm_vpn_plugin_utils_c + [libnm_enum[1]], include_directories: libnm_inc, dependencies: nm_core_dep, c_args: cflags diff --git a/libnm/tests/test-nm-client.c b/libnm/tests/test-nm-client.c index 63822882..21272e4d 100644 --- a/libnm/tests/test-nm-client.c +++ b/libnm/tests/test-nm-client.c @@ -70,6 +70,9 @@ test_device_added (void) GError *error = NULL; sinfo = nmtstc_service_init (); + if (!nmtstc_service_available (sinfo)) + return; + client = nm_client_new (NULL, &error); g_assert_no_error (error); @@ -163,6 +166,9 @@ test_device_added_signal_after_init (void) GError *error = NULL; sinfo = nmtstc_service_init (); + if (!nmtstc_service_available (sinfo)) + return; + client = nm_client_new (NULL, &error); g_assert_no_error (error); @@ -311,6 +317,9 @@ test_wifi_ap_added_removed (void) char *expected_path = NULL; sinfo = nmtstc_service_init (); + if (!nmtstc_service_available (sinfo)) + return; + client = nm_client_new (NULL, &error); g_assert_no_error (error); @@ -510,6 +519,9 @@ test_wimax_nsp_added_removed (void) char *expected_path = NULL; sinfo = nmtstc_service_init (); + if (!nmtstc_service_available (sinfo)) + return; + client = nm_client_new (NULL, &error); g_assert_no_error (error); @@ -686,6 +698,8 @@ test_devices_array (void) GVariant *ret; sinfo = nmtstc_service_init (); + if (!nmtstc_service_available (sinfo)) + return; /* Make sure that we test the async codepath in at least one test... */ nm_client_new_async (NULL, new_client_cb, &client); @@ -778,7 +792,8 @@ nm_running_changed (GObject *client, static void test_client_nm_running (void) { - NMClient *client1, *client2; + gs_unref_object NMClient *client1 = NULL; + gs_unref_object NMClient *client2 = NULL; guint quit_id; int running_changed = 0; GError *error = NULL; @@ -801,6 +816,9 @@ test_client_nm_running (void) /* Now start the test service. */ sinfo = nmtstc_service_init (); + if (!nmtstc_service_available (sinfo)) + return; + client2 = nm_client_new (NULL, &error); g_assert_no_error (error); @@ -828,9 +846,6 @@ test_client_nm_running (void) g_assert_cmpint (running_changed, ==, 2); g_assert (!nm_client_get_nm_running (client1)); g_source_remove (quit_id); - - g_object_unref (client1); - g_object_unref (client2); } typedef struct { @@ -934,6 +949,9 @@ test_active_connections (void) GError *error = NULL; sinfo = nmtstc_service_init (); + if (!nmtstc_service_available (sinfo)) + return; + client = nm_client_new (NULL, &error); g_assert_no_error (error); @@ -1063,6 +1081,9 @@ test_activate_virtual (void) GError *error = NULL; sinfo = nmtstc_service_init (); + if (!nmtstc_service_available (sinfo)) + return; + client = nm_client_new (NULL, &error); g_assert_no_error (error); @@ -1138,6 +1159,9 @@ test_activate_failed (void) GError *error = NULL; sinfo = nmtstc_service_init (); + if (!nmtstc_service_available (sinfo)) + return; + client = nm_client_new (NULL, &error); g_assert_no_error (error); @@ -1172,6 +1196,9 @@ test_device_connection_compatibility (void) const char *hw_addr2 = "52:54:00:ab:db:24"; sinfo = nmtstc_service_init (); + if (!nmtstc_service_available (sinfo)) + return; + client = nm_client_new (NULL, &error); g_assert_no_error (error); @@ -1345,10 +1372,8 @@ test_connection_invalid (void) FALSE, &path3); - nmtst_main_loop_run (loop, 1000); - connections = nm_client_get_connections (client); g_assert (connections); @@ -1595,4 +1620,3 @@ main (int argc, char **argv) return g_test_run (); } - diff --git a/libnm/tests/test-remote-settings-client.c b/libnm/tests/test-remote-settings-client.c index f6c37e91..45d60c06 100644 --- a/libnm/tests/test-remote-settings-client.c +++ b/libnm/tests/test-remote-settings-client.c @@ -63,6 +63,9 @@ test_add_connection (void) time_t start, now; gboolean done = FALSE; + if (!nmtstc_service_available (sinfo)) + return; + connection = nmtst_create_minimal_connection (TEST_CON_ID, NULL, NM_SETTING_WIRED_SETTING_NAME, NULL); nm_client_add_connection_async (client, @@ -137,6 +140,9 @@ test_make_invisible (void) gboolean has_settings = FALSE; char *path; + if (!nmtstc_service_available (sinfo)) + return; + g_assert (remote != NULL); /* Listen for the remove event when the connection becomes invisible */ @@ -215,6 +221,9 @@ test_make_visible (void) char *path; NMRemoteConnection *new = NULL; + if (!nmtstc_service_available (sinfo)) + return; + g_assert (remote != NULL); /* Wait for the new-connection signal when the connection is visible again */ @@ -304,6 +313,9 @@ test_remove_connection (void) gboolean done = FALSE; char *path; + if (!nmtstc_service_available (sinfo)) + return; + /* Find a connection to delete */ conns = nm_client_get_connections (client); g_assert_cmpint (conns->len, >, 0); @@ -384,6 +396,9 @@ test_add_remove_connection (void) time_t start, now; gboolean done = FALSE; + if (!nmtstc_service_available (sinfo)) + return; + /* This will cause the test server to immediately delete the connection * after creating it. */ @@ -437,6 +452,9 @@ test_add_bad_connection (void) time_t start, now; gboolean done = FALSE; + if (!nmtstc_service_available (sinfo)) + return; + /* The test daemon doesn't support bond connections */ connection = nmtst_create_minimal_connection ("bad connection test", NULL, NM_SETTING_BOND_SETTING_NAME, NULL); @@ -480,6 +498,9 @@ test_save_hostname (void) gboolean done = FALSE; GError *error = NULL; + if (!nmtstc_service_available (sinfo)) + return; + /* test-networkmanager-service.py requires the hostname to contain a '.' */ nm_client_save_hostname (client, "foo", NULL, &error); g_assert_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_HOSTNAME); diff --git a/libnm/tests/test-secret-agent.c b/libnm/tests/test-secret-agent.c index 25752e9a..746a9e64 100644 --- a/libnm/tests/test-secret-agent.c +++ b/libnm/tests/test-secret-agent.c @@ -247,6 +247,9 @@ test_setup (TestSecretAgentData *sadata, gconstpointer test_data) GError *error = NULL; sadata->sinfo = nmtstc_service_init (); + if (!sadata->sinfo) + return; + sadata->client = nm_client_new (NULL, &error); g_assert_no_error (error); @@ -311,6 +314,9 @@ test_cleanup (TestSecretAgentData *sadata, gconstpointer test_data) GVariant *ret; GError *error = NULL; + if (!sadata->sinfo) + return; + if (sadata->agent) { if (nm_secret_agent_old_get_registered (sadata->agent)) { nm_secret_agent_old_unregister (sadata->agent, NULL, &error); @@ -360,6 +366,9 @@ connection_activated_none_cb (GObject *c, static void test_secret_agent_none (TestSecretAgentData *sadata, gconstpointer test_data) { + if (!nmtstc_service_available (sadata->sinfo)) + return; + nm_client_activate_connection_async (sadata->client, sadata->connection, sadata->device, @@ -405,6 +414,9 @@ connection_activated_no_secrets_cb (GObject *c, static void test_secret_agent_no_secrets (TestSecretAgentData *sadata, gconstpointer test_data) { + if (!nmtstc_service_available (sadata->sinfo)) + return; + g_signal_connect (sadata->agent, "secret-requested", G_CALLBACK (secrets_requested_no_secrets_cb), sadata); @@ -456,6 +468,9 @@ secrets_requested_cancel_cb (TestSecretAgent *agent, static void test_secret_agent_cancel (TestSecretAgentData *sadata, gconstpointer test_data) { + if (!nmtstc_service_available (sadata->sinfo)) + return; + g_signal_connect (sadata->agent, "secret-requested", G_CALLBACK (secrets_requested_cancel_cb), sadata); @@ -510,6 +525,9 @@ secrets_requested_good_cb (TestSecretAgent *agent, static void test_secret_agent_good (TestSecretAgentData *sadata, gconstpointer test_data) { + if (!nmtstc_service_available (sadata->sinfo)) + return; + g_signal_connect (sadata->agent, "secret-requested", G_CALLBACK (secrets_requested_good_cb), sadata); @@ -526,7 +544,6 @@ test_secret_agent_good (TestSecretAgentData *sadata, gconstpointer test_data) g_assert_cmpint (sadata->secrets_requested, ==, 1); } - static void async_init_cb (GObject *object, GAsyncResult *result, gpointer user_data) { @@ -566,7 +583,6 @@ test_secret_agent_nm_not_running (void) g_main_loop_unref (loop); } - static void registered_changed (GObject *object, GParamSpec *pspec, gpointer user_data) { @@ -584,6 +600,9 @@ test_secret_agent_auto_register (void) GError *error = NULL; sinfo = nmtstc_service_init (); + if (!nmtstc_service_available (sinfo)) + return; + loop = g_main_loop_new (NULL, FALSE); agent = test_secret_agent_new (); @@ -611,6 +630,8 @@ test_secret_agent_auto_register (void) /* Restart test service */ sinfo = nmtstc_service_init (); + g_assert (nmtstc_service_available (sinfo)); + g_main_loop_run (loop); g_assert (nm_secret_agent_old_get_registered (agent)); |