summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* wifi: Empty AP BSSID is NULL, not an invalid addressth/bgo739258_wifi_bssid_fixesLubomir Rintel2014-10-271-1/+1
| | | | | | | | | | | Since 3a54d050 the AP address is not a gbyte[], but a char *. The fake AP BSSID fixup could trigger an assertion failure: Oct 26 11:14:45 goatlord.localdomain NetworkManager[540]: nm_ethernet_address_is_valid: assertion 'addr != NULL' failed https://bugzilla.gnome.org/show_bug.cgi?id=739258 Fixes: 3a54d050985d6ef2067b025571910a8ccd3cbd57
* wifi: avoid assertion in nm_ap_check_compatible() when comparing AP with ↵Thomas Haller2014-10-271-1/+1
| | | | | | missing BSSID Signed-off-by: Thomas Haller <thaller@redhat.com>
* wifi: ensure not passing NULL bssid as string to printf logging functionsThomas Haller2014-10-272-11/+8
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* merge: fix default-unmanaged devices being unavailable for activation (bgo ↵Dan Williams2014-10-273-80/+159
|\ | | | | | | #738588)
| * core: autoconnect fixes for default-unmanaged devices and property notificationDan Williams2014-10-273-9/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the only thing preventing default-unmanaged devices from being auto-activated was luck and the fact that they didn't have any available connections when in the UNMANAGED state. That's no longer true, so we must be more explicit about their behavior. Furthermore it makes no sense to allow default-unmanaged devices to set priv->autoconnect=TRUE since that is never supposed to happen, so enforce that both in NM itself and if the change request comes in over the D-Bus interface. Lastly, internal priv->autoconnect=TRUE changes never emitted a property change notification, meaning the NMPolicy would never schedule an autoconnect check if the device's priv->autoconnect was set to TRUE as a result of re-activating or waking from sleep.
| * core: loosen master device carrier check before IP configurationDan Williams2014-10-271-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously a master device would wait for a carrier before starting IP configuration only for 'manual' connections, but that's not quite broad enough. We also want to allow SHARED methods to proceed immediately since they are also effectively static/manual configuration. Use the newly split out methods for checking whether a connection requires a carrier or not to allow the SHARED method to proceed for master devices without a carrier. For example, this allows bridge configurations with tun/tap ports to set up SHARED addressing before the tun/tap gets a carrier which only happens when something opens the other side of the tun/tap (like the VM or container).
| * trivial: move connection_requires_carrer() upDan Williams2014-10-271-73/+73
| | | | | | | | No code change, only move above a future user.
| * core: refactor connection_requires_carrier() to split out method checkingDan Williams2014-10-271-15/+38
| | | | | | | | The split out functions will be used next for master/slave decisions.
| * core: use _nm_utils_string_in_list() instead of private functionDan Williams2014-10-271-14/+5
| |
| * core: shared connections don't require a carrierDan Williams2014-10-271-1/+2
| | | | | | | | | | They are effectively static connections since the address is manually assigned, so they do not require a carrier.
| * core: allow default unmanaged devices to have available connections when ↵Dan Williams2014-10-271-3/+11
|/ | | | | | | | | unmanaged Default unmanaged devices become managed when the user explicitly activated a connection on the device, but the user can't do that unless the device has some available connections. Fix things up so that default unmanaged devices can have available connections.
* dhclient: allow single hex digits in hexadecimal dhcp_client_idThomas Haller2014-10-272-3/+40
| | | | | | | | | | When checking whether the dhcp-client-identifier is a hex string, we expected pairs of hexadecimal digits separated by colon. Relax this check to also allow single hex digits. https://bugzilla.gnome.org/show_bug.cgi?id=737727 Signed-off-by: Thomas Haller <thaller@redhat.com>
* build: fix srcdir != builddirDan Winship2014-10-241-0/+1
| | | | | callouts/tests/ needs -I$(top_builddir)/callouts to get nmdbus-dispatcher.h
* contrib/rpm: Avoid unowned directoriesLubomir Rintel2014-10-241-0/+2
|
* ibft: fix uninitialized variableDan Williams2014-10-231-1/+1
|
* core: add PrimaryConnectionType property to NMManager (bgo #739080)Ryan Lortie2014-10-234-0/+35
| | | | | | | | | | | | | | | | | | | | This will provide an extremely easy way for applications to find out what type of connection the system is currently using. They might want to do this to avoid using data if a phone is on a 3G connection, for example. Having this as a separate property provides at least two advantages: 1) it reduces code complexity for those wanting only this one simple piece of information 2) we could allow access to this property (but nothing else) to privilege-separated applications in the future This patch adds the missing nm_active_connection_get_connection_type() which was in the header file but never actually implemented. https://bugzilla.gnome.org/show_bug.cgi?id=739080
* man: add an example for ifcfg configuration of bridgesJiří Klimeš2014-10-231-0/+20
|
* Merge: fix some memory leaks (bgo #739013)Jiří Klimeš2014-10-234-6/+22
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=739013
| * libnm-core: fix a leak in process_properties_changed()Jiří Klimeš2014-10-231-1/+1
| |
| * libnm-core: do not leak GValue in _nm_setting_new_from_dbus()Jiří Klimeš2014-10-231-0/+1
| |
| * libnm-core: do not leak the path in connectionsJiří Klimeš2014-10-231-0/+1
| |
| * all: fix g_dbus_proxy_get_name_owner() leaksJiří Klimeš2014-10-232-5/+19
|/
* wwan: fix wwan-exports.verDan Winship2014-10-221-1/+0
|
* core: Remove use of NM_SESSION_MONITOR_ERROR domainLubomir Rintel2014-10-221-24/+21
| | | | | | | | It no longer exists. Also, the special case of ENOENT handling in nm-session-monitor-ck is removed; it's not worth keeping it around just to print a log message when the error is ignored nayway.
* all: consolidate error domains and fix up D-Bus error mapping (bgo #735900)Dan Winship2014-10-22220-4462/+2257
|\
| * core: drop all remaining core-internal error domainsDan Winship2014-10-2217-215/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A number of classes in core had their own error domains that aren't really necessary. In the case of NMDcbError, NMDhcpManagerError, NMDnsManagerError, NMDnsmasqManagerError, NMPppManagerError, and NMSessionMonitorError, most of the codes they defined weren't even being used, and at any rate, the errors were always returned into contexts where they would just have their message extracted and then get thrown away without anyone ever looking at the domain or code. So all uses of those domains can just be replaced with NM_MANAGER_ERROR_FAILED without any loss of information. NMAuthManagerError only had 1 error code, and it just indicated "something went wrong", so it can be replaced with NM_MANAGER_ERROR_FAILED without loss of information. (nm-auth-manager.c has also been fixed to return NM_MANAGER_ERROR_FAILED when the CheckAuthorization D-Bus call fails, rather than returning whatever error domain/code the D-Bus call returned.) NMVpnManagerError used 2 of its 4 error codes, and they could actually end up getting returned across D-Bus in some cases. But there are NMManagerError codes that are semantically similar enough to make the NMVpnManagerError ones unnecessary.
| * libnm: consolidate NMClientError and NMObjectErrorDan Winship2014-10-2211-113/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | Consolidate NMClientError and NMObjectError (such that there is now only one libnm-API-specific error domain). In particular, merge NM_CONNECTION_ERROR_CONNECTION_REMOVED with NM_OBJECT_ERROR_OBJECT_CREATION_FAILURE as the new NM_CONNECTION_ERROR_OBJECT_CREATION_FAILED. Also make object_creation_failed() be a plain method rather than a signal, since there's no reason for anyone to be connecting to it on another object. And remove its GError argument because the subclass can just create its own more-specific error.
| * libnm: strip GDBus gunk from GErrorsDan Winship2014-10-2211-68/+160
| | | | | | | | | | Call g_dbus_error_strip_remote_error() on all errors returned from gdbus calls. (Blah!)
| * libnm: drop _nm_dbus_register_error_domain()Dan Winship2014-10-222-25/+0
| | | | | | | | All D-Bus error domains are registered from libnm-core now.
| * libnm-core, libnm: move NMVpnPluginError to nm-errorsDan Winship2014-10-224-60/+53
| | | | | | | | | | | | | | | | | | | | Move the definition of NMVpnPluginError to nm-errors and register it with D-Bus. Rename GENERAL to FAILED, and CONNECTION_INVALID to INVALID_CONNECTION, for consistency. (As with the NMSecretAgentError renamings, the renaming here is not an ABI break, because the daemon currently never checks for any specific error codes other than INTERACTIVE_NOT_SUPPORTED.)
| * libnm-core, libnm, settings: move NMSecretAgentError to nm-errorsDan Winship2014-10-226-59/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the definition of NMSecretAgentError to nm-errors, register it with D-Bus, and verify in the tests that it maps correctly. NM_SECRET_AGENT_ERROR_INTERNAL_ERROR is renamed to NM_SECRET_AGENT_ERROR_FAILED, and NM_SECRET_AGENT_ERROR_NOT_AUTHORIZED to NM_SECRET_AGENT_ERROR_PERMISSION_DENIED, for consistency with other error domains. While NMSecretAgentError, unlike most other error domains, has always been correctly mapped across D-Bus, the renaming is not an ABI break, because the daemon never checks for either of those values, so all versions of the daemon will treat "org.freedesktop.NetworkManager.SecretAgent.InternalError" and "org.freedesktop.NetworkManager.SecretAgent.Failed" the same (by just ignoring the error name and keeping only the error message).
| * libnm-core, settings: move NMAgentManagerError to nm-errorsDan Winship2014-10-227-45/+47
| | | | | | | | | | Move the definition of NMAgentManagerError to nm-errors, register it with D-Bus, and verify in the tests that it maps correctly.
| * settings: drop plugin-specific error domainsDan Winship2014-10-2239-559/+271
| | | | | | | | | | | | Each plugin defined its own error domain, though none actually defined any errors. Replace these with appropriate uses of NM_SETTINGS_ERROR_INVALID_CONNECTION and NM_SETTINGS_ERROR_FAILED.
| * libnm-core, settings: move NMSettingsError to nm-errorsDan Winship2014-10-2214-110/+104
| | | | | | | | | | | | | | | | | | Move the definition of NMSettingsError to nm-errors, register it with D-Bus, and verify in the tests that it maps correctly. Remove a few unused error codes, simplify a few others, and rename GENERAL to FAILED and HOSTNAME_INVALID to INVALID_HOSTNAME, for consistency.
| * libnm-core, core: merge NMLoggingError into NMManagerErrorDan Winship2014-10-224-24/+7
| | | | | | | | | | | | | | NMManagerError has other operation-specific errors (like NM_MANAGER_ERROR_ALREADY_ASLEEP_OR_AWAKE), so it makes sense to move NM_LOGGING_ERROR_UNKNOWN_LEVEL and NM_LOGGING_ERROR_UNKNOWN_DOMAIN there too rather than having them in their own tiny error domain.
| * libnm-core, core: move NMManagerError to nm-errorsDan Winship2014-10-227-60/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the definition of NMManagerError to nm-errors, register it with D-Bus, and verify in the tests that it maps correctly. NM_MANAGER_ERROR_INTERNAL gets renamed to NM_MANAGER_ERROR_FAILED for consistency. NM_MANAGER_ERROR_UNMANAGED_DEVICE is dropped since that name doesn't really describe the one place it was previously used in. NM_MANAGER_ERROR_SYSTEM_CONNECTION is dropped because it was't being used. NM_MANAGER_ERROR_UNSUPPORTED_CONNECTION_TYPE is dropped because it can be replaced with an NM_CONNECTION_ERROR. NM_MANAGER_ERROR_AUTOCONNECT_NOT_ALLOWED is turned into the more generic NM_MANAGER_ERROR_CONNECTION_NOT_AVAILABLE. Also, remove the <tp:possible-errors> sections from nm-manager.xml, since they were completely out of date.
| * devices: drop device-type-specific error domainsDan Winship2014-10-2224-295/+63
| | | | | | | | | | | | Most NMDevice types defined their own error domain but then never used it. A few did use their errors, but some of those errors are redundant with NMDeviceError, and others can be added to it.
| * libnm-core, libnm, devices: merge client and daemon NMDeviceErrorDan Winship2014-10-228-58/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge libnm's NMDeviceError and the daemon's NMDeviceError into a single enum (in nm-errors.h). Register the domain with D-Bus, and add a test that the client side decodes it correctly. The daemon's NM_DEVICE_ERROR_CONNECTION_INVALID gets absorbed into libnm's NM_DEVICE_ERROR_INVALID_CONNECTION, and NM_DEVICE_ERROR_UNSUPPORTED_DEVICE_TYPE gets dropped, since it was only returned from one place, which is now using NM_DEVICE_ERROR_FAILED, since (a) it ought to be a "can't happen", and (b) the only caller of that function just logs error->message and then frees the error without ever looking at the code.
| * libnm: merge device-type-specific errors into NMDeviceErrorDan Winship2014-10-2230-761/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As with the settings, each device type was defining its own error type, containing either redundant or non-useful error codes. Drop all of the subtype-specific errors, and reduce things to just NM_DEVICE_ERROR_FAILED, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION, and NM_DEVICE_ERROR_INVALID_CONNECTION. The device-type-specific errors were only returned from their nm_device_connection_compatible() implementations, so this is also a good opportunity to simplify those, by moving duplicated functionality into the base NMDevice implementation, and then allowing the subclasses to assume that the connection has already been validated in their own code. Most of the implementations now just check that the connection has the correct type for the device (which can't be done at the NMDevice level since some device types (eg, Ethernet) support multiple connection types.) Also, make sure that all of the error messages are localized.
| * libnm: drop unused NMRemoteConnectionErrorDan Winship2014-10-223-32/+0
| | | | | | | | | | | | | | | | | | NMRemoteConnection used to return NM_REMOTE_CONNECTION_ERROR_DISCONNECTED if you tried to operate on a connection that had been disconnected from its D-Bus proxy. But this disappeared in the gdbus port (since gdbus doesn't emit a signal when it happens, so it's harder to notice. And it's not clear why NMRemoteConnection did this when no other class did anyway...).
| * libnm-core, core: register NMConnectionError with D-BusDan Winship2014-10-227-4/+112
| | | | | | | | | | | | Register NMConnectionError with D-Bus on both sides, so that, eg, connection validation failures in the daemon will translate to the correct error codes in the client.
| * libnm-core: add nm-errors.[ch]Dan Winship2014-10-2211-85/+142
| | | | | | | | | | | | | | | | Add nm-errors.[ch], and move libnm-core's two error domains (NMConnectionError and NMCryptoError) there. NMCryptoError wasn't previously visible, but it can be returned from some public API, so it should be.
| * libnm-core: fix up/simplify NMCryptoErrorDan Winship2014-10-224-101/+84
| | | | | | | | | | | | | | Many of NMCryptoError's codes would basically never be useful for programs to distinguish between. Streamline the codes, and fix the enumeration member names to start with "NM_CRYPTO_ERROR_" rather than "NM_CRYPTO_ERR_".
| * libnm-core: merge NMSetting*Error into NMConnectionErrorDan Winship2014-10-2269-1703/+791
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each setting type was defining its own error type, but most of them had exactly the same three errors ("unknown", "missing property", and "invalid property"), and none of the other values was of much use programmatically anyway. So, this commit merges NMSettingError, NMSettingAdslError, etc, all into NMConnectionError. (The reason for merging into NMConnectionError rather than NMSettingError is that we also already have "NMSettingsError", for errors related to the settings service, so "NMConnectionError" is a less-confusable name for settings/connection errors than "NMSettingError".) Also, make sure that all of the affected error messages are localized, and (where appropriate) prefix them with the relevant property name. Renamed error codes: NM_SETTING_ERROR_PROPERTY_NOT_FOUND -> NM_CONNECTION_ERROR_PROPERTY_NOT_FOUND NM_SETTING_ERROR_PROPERTY_NOT_SECRET -> NM_CONNECTION_ERROR_PROPERTY_NOT_SECRET Remapped error codes: NM_SETTING_*_ERROR_MISSING_PROPERTY -> NM_CONNECTION_ERROR_MISSING_PROPERTY NM_SETTING_*_ERROR_INVALID_PROPERTY -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_BLUETOOTH_ERROR_TYPE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_INVALID_SETTING NM_SETTING_BOND_ERROR_INVALID_OPTION -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_BOND_ERROR_MISSING_OPTION -> NM_CONNECTION_ERROR_MISSING_PROPERTY NM_SETTING_CONNECTION_ERROR_TYPE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_MISSING_SETTING NM_SETTING_CONNECTION_ERROR_SLAVE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_MISSING_SETTING NM_SETTING_IP4_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_VLAN_ERROR_INVALID_PARENT -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_802_1X_SETTING -> NM_CONNECTION_ERROR_MISSING_SETTING NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_802_1X -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_USERNAME -> NM_CONNECTION_ERROR_MISSING_PROPERTY NM_SETTING_WIRELESS_SECURITY_ERROR_SHARED_KEY_REQUIRES_WEP -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_WIRELESS_ERROR_CHANNEL_REQUIRES_BAND -> NM_CONNECTION_ERROR_MISSING_PROPERTY Dropped error codes (were previously defined but unused): NM_SETTING_CDMA_ERROR_MISSING_SERIAL_SETTING NM_SETTING_CONNECTION_ERROR_IP_CONFIG_NOT_ALLOWED NM_SETTING_GSM_ERROR_MISSING_SERIAL_SETTING NM_SETTING_PPP_ERROR_REQUIRE_MPPE_NOT_ALLOWED NM_SETTING_PPPOE_ERROR_MISSING_PPP_SETTING NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING NM_SETTING_WIRELESS_ERROR_MISSING_SECURITY_SETTING
| * libnm-core: clean up NMConnectionErrorDan Winship2014-10-229-86/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename NM_CONNECTION_ERROR_UNKNOWN to NM_CONNECTION_ERROR_FAILED, following GError best practices. Replace NM_CONNECTION_ERROR_CONNECTION_SETTING_NOT_FOUND ("no NMSettingConnection") with a more generic NM_CONNECTION_ERROR_MISSING_SETTING. Use that new code in a few places that had previously been using NM_CONNECTION_ERROR_SETTING_NOT_FOUND, which was supposed to mean "the setting that you asked about doesn't exist", not "the connection is invalid because it's missing a required setting". Clarify that NM_CONNECTION_ERROR_INVALID_SETTING can be used for any "invalid or inappropriate NMSetting", not just a "conflicting" one. (But fix a case in nm_connection_update_secrets() that was returning INVALID_SETTING when it should have been return-if-failing instead.) For both MISSING_SETTING and INVALID_SETTING, always prefix the error message with "setting-name: ", just like we do with the various NMSetting MISSING_PROPERTY and INVALID_PROPERTY errors. And make sure that the error message is marked for localization. Drop NM_CONNECTION_ERROR_CONNECTION_TYPE_INVALID, which is pretty pointless; it was only used in the case where connection.type was the name of a valid setting type that is not a base setting type. Instead, just return NM_SETTING_CONNECTION_ERROR_INVALID_PROPERTY for connection.type in this case (which is what the code already did when connection.type was completely unrecognized).
| * libnm-core: drop nm_setting_lookup_type_by_quark()Dan Winship2014-10-228-53/+11
|/ | | | | | | | | | | | nm_setting_lookup_type_by_quark() was only ever used in places that were still mistakenly assuming the old style of nm_connection_verify() errors, where the error message would contain only a property name and no further explanation. Fix those places to assume that the error will contain a real error message, and include both the setting name and the property name. Given that, there's no longer any need for nm_setting_lookup_type_by_quark(), so drop it.
* tui: fix incorrect chain up to parentDan Williams2014-10-211-1/+1
|
* core: let kernel add IPv6LL address when method=ignore (rh #1132938)Dan Williams2014-10-211-1/+15
| | | | | | | | | The IPv6LL address handling in userspace patches failed to handle the case where the IPv6 method was 'ignore'. Previously the kernel would usually add the IPv6LL address itself, but if NM has turned off kernel IPv6LL then obviously this wouldn't happen. So when the method is 'ignore', turn off userspace IPv6LL handling and bounce disable_ipv6 to make the kernel add the IPv6LL address if it wants to.
* nmtst: fix a bug in NMTST_VARIANT_EDITORDan Winship2014-10-211-2/+2
| | | | | NMTST_VARIANT_EDITOR would crash if you tried to drop different properties (or two different settings).
* libnm: fix NMActiveConnection:specific-object-pathDan Winship2014-10-212-2/+21
| | | | | | NMActiveConnection:specific-object was renamed to NMActiveConnection:specific-object-path in 677314c5, but it didn't actually work, because of assumptions NMObject makes. Fix that.