summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* fixup! libnm-util: make failure cases for nm_connection_normalize() more ↵th/bgo696936_normalize_settings-1Thomas Haller2014-07-281-2/+2
| | | | robust against bugs
* libnm-util: make failure cases for nm_connection_normalize() more robust ↵Thomas Haller2014-07-281-9/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | against bugs We would expect that attempts to normalize a connection are successful as verify() indicates. This way, a connection is not modified if it cannot be fixed, and a connection will be valid and modified after attempts to normalization. However, there might be subtle, unexpected ways how this can fail. For example, if NMSettingConnection:verify() detects a missing base type setting, it returns NORMALIZABLE_ERROR if it finds a valid NMSettingConnection:type. Normalization then adds an empty, default setting. However, a new verify() might fail due to other reasons. This would be a bug in NMSettingConnection:verify() which must not indicate that it is able to normalize the connection, when it actually is unable to do so. Such bugs need fixing, but the code should be more robust to this case because there might be complex, unanticipated situations. Especially since NM relies on having a valid connection after normalize(), so a strict error-out behavior is important. Signed-off-by: Thomas Haller <thaller@redhat.com>
* keyfile/tests: add reading minimal slave keyfilesThomas Haller2014-07-286-0/+93
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* keyfile/tests: add read_connection_from_file() utility functionThomas Haller2014-07-281-0/+21
|
* keyfile: don't add [connection].type base setting which is done by ↵Thomas Haller2014-07-281-21/+0
| | | | | | | | | nm_connection_normalize() This undoes commit 9f8b7ff51dfd7cdb828fe5e7b50016c5587e8657 but the same functionality is now provided via normalize(). Signed-off-by: Thomas Haller <thaller@redhat.com>
* fixup! libnm-util: normalize NMSettingConnection:type propertyThomas Haller2014-07-281-8/+2
|
* fixup! libnm-util: normalize NMSettingConnection:type propertyThomas Haller2014-07-281-4/+4
|
* libnm-util: normalize NMSettingConnection:type propertyThomas Haller2014-07-285-15/+137
| | | | | | | | | nm_connection_normalize() can now detect the 'type' property based on existing base settings. It can also create a (default) base setting. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: stricter verification of NMSettingConnection:type propertyThomas Haller2014-07-281-23/+32
| | | | | | | Now also verify the 'type' property regardless of existing @all_settings. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: minor refactoring in NMSettingConnection:verify()Thomas Haller2014-07-281-29/+31
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* keyfile: remove ensure_slave_setting() when reading connectionThomas Haller2014-07-281-31/+4
| | | | | | | | | | nm_connection_normalize() can now add the slave setting as needed. Remove the duplicate functionality. This undoes commit 664d64e0c04bd4b83137a682ff9a9881966f6f94 but the same functionality is now provided via normalize(). Signed-off-by: Thomas Haller <thaller@redhat.com>
* fixup! libnm-util: normalize slave-type and slave-settings of connectionsThomas Haller2014-07-281-9/+3
|
* fixup! libnm-util: normalize slave-type and slave-settings of connectionsThomas Haller2014-07-274-6/+11
|
* libnm-util: normalize slave-type and slave-settings of connectionsThomas Haller2014-07-279-14/+272
| | | | | | | | | | Some NMSettingConnection:slave-type types require a matching slave #NMSetting. Add normalization of either the 'slave-type' property or the slave-setting. Also be more strict in NMSettingConnection:verify() to enforce an existing slave-setting depending on the slave-type. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: move validation of NMSettingConnection:type to ↵Thomas Haller2014-07-272-40/+23
| | | | | | | | | NMSettingConnection:verify() Partly it was already there. This makes NMSettingConnection:verify() stricter then before, but validates the same as of NMConnection:_nm_connection_verify(). Signed-off-by: Thomas Haller <thaller@redhat.com>
* fixup! libnm-util: properly disconnect "notify" signal for settings in ↵Thomas Haller2014-07-271-3/+1
| | | | NMConnection
* libnm-util: properly disconnect "notify" signal for settings in NMConnectionThomas Haller2014-07-271-12/+20
| | | | | | | When removing/replacing a NMSetting in an NMConnection, we have to disconnect setting_changed_cb() from the "notify" signal. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: don't set GError on invalid @connection argument in ↵Thomas Haller2014-07-271-10/+2
| | | | | | | | | | _nm_connection_verify() In general, we don't set errors if passing a completely invalid @self pointer to a method. We usually also don't set the error argument when asserting. So, just drop it. Signed-off-by: Thomas Haller <thaller@redhat.com>
* fixup! libnm-util: add _nm_setting_find_in_list_required() functionThomas Haller2014-07-271-1/+1
|
* libnm-util: add _nm_setting_find_in_list_required() functionThomas Haller2014-07-272-0/+33
| | | | | | | | | | | This is an utility function that can be called during verify() to find an NMSetting from @all_settings. This is especially useful for looking up the NMSettingConnection which usually is present. So just get it quickly. In the unexpected case that it is missing, it sets @error and we can return. Signed-off-by: Thomas Haller <thaller@redhat.com>
* ifcfg-rh: remove verify() connection during readingThomas Haller2014-07-271-34/+0
| | | | | | | | | | | | | At the end of reading the connection, reader calls nm_connection_normalize() to normalize the connection. Normalization inplicitly verifies the connection. Doing a verify along the way is not needed and even harmful. Soon further checks will be added that make verify() fail, but normalize() can fix the connection. So, while reading, we might actually have an invalid connection, that will be normalized as last step. Signed-off-by: Thomas Haller <thaller@redhat.com>
* keyfile: let reader normalize() the connection, not only verify()Thomas Haller2014-07-272-10/+10
| | | | | | | | The new nm_connection_normalize() function allows to fixup an incomplete connection. The keyfile reader should call normalize on a connection, so that we can implement common normalizations there instead of inside the settings plugin. Signed-off-by: Thomas Haller <thaller@redhat.com>
* keyfile/tests: refactor tests to use nmtst_assert_connection_equals() functionThomas Haller2014-07-271-14/+8
| | | | | | | Needed in the next commit when we have to normalize the connection before comparing. Signed-off-by: Thomas Haller <thaller@redhat.com>
* keyfile: reader adds NMSettingConnection if missingThomas Haller2014-07-271-30/+32
| | | | | | | | The recent change c88b832ce9510bdcb2df2bf7e02b1ded88154581 allows for missing 'id' and 'uuid' entries. Further make the keyfile reader more accepting, by creating a missing NMSettingConnection. Signed-off-by: Thomas Haller <thaller@redhat.com>
* fixup! nmtst: add assertion functions for verify() connectionThomas Haller2014-07-271-5/+33
|
* nmtst: add assertion functions for verify() connectionThomas Haller2014-07-271-0/+78
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* nmtst: add nmtst_create_minimal_connection() functionThomas Haller2014-07-271-0/+38
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* nmtst: add nmtst_assert_connection_equals() functionThomas Haller2014-07-271-0/+39
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* nmtst: add nmtst_connection_normalize() functionThomas Haller2014-07-271-0/+68
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* all: use nm_intern_utils_hash_values_to_slist()Thomas Haller2014-07-275-47/+14
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: add nm_intern_utils_hash_values_to_slist()Thomas Haller2014-07-273-0/+19
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* all: add nm-utils-internal.h headerThomas Haller2014-07-2712-87/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This partly undoes commit 6cb6d3972558bb89cbb83ac1b87595dc33ed665a. Merging the two header files was wrong because they serve a different purpose: 1) nm-utils-private.h: this is for stuff that is used accross modules *inside* libnm-util. No symbols are exported and hence including this file outside of libnm-util/ is wrong. 2) nm-utils-internal.h: (pre 6cb6d397, this was named nm-util-private.h) This header contains functionality that is used by other components *inside* the source tree, for example NM-core. It can be included, and libnm-util.so will export symbols for it. However, it is not part of the documented (stable) API, and other projects outside of NetworkManager should not use it and not rely on a stable API. However, we still have to provide ABI backward compatibility for the exported functions. Note, that it removes the trick using NMUtilsPrivateData to export internal functions. Instead export the internal functions directly, but give them the commont prefix nm_internal_*(). Even for the NMUtilsPrivateData provided functions we must preserve ABI and functional backward compatibility. So the only advantage of using the struct is that we can retire exported symbols. However, we still have to provide the functionality and binary interface. This doesn't give us significantly more flexibility when retiring internal functions, so just export them directly. Since internal functions share a distingished name prefix, this is acceptable. nm_utils_get_private() is still available not to break ABI. The naming convention for internally exported function is the prefix nm_internal_* -- instead of nm_*. Note, that nm-utils-internal.h serves two different purposes: 2a) provide special access to internal functionality of libnm-util. This use is discouraged in general because the library should expose useful functions as public API and library users inside the source tree should not be special. One use of this is NetworkManager core (which is a special user because it implements server-side) or testing. 2b) share general utility code between components of NetworkManager. This is for general purpose functions that are needed *inside* libnm-util, but that are useful to other components. In this case, the other components already link against libnm-util, so it makes sense to reuse code. Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-glib: fix gtk-doc for NMClient:active-connectionsThomas Haller2014-07-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since previous commit dafe51e8819c31ef6c0a7e901e43e821e229650f, the gtk-doc is no longer ignored. However, the angle brackets add invalid XML characters to ./docs/libnm-glib/xml/nm-client.xml This breaks the build. make[3]: Entering directory `./NetworkManager/docs/libnm-glib' DOC Scanning header files DOC Introspecting gobjects DOC Building HTML ../xml/nm-client.xml:1110: parser error : Opening and ending tag mismatch: NMActiveConnection line 1109 and para </para></refsect2> ^ ../xml/nm-client.xml:1110: parser error : Opening and ending tag mismatch: para line 1107 and refsect2 </para></refsect2> ^ ../xml/nm-client.xml:1211: parser error : Opening and ending tag mismatch: refsect2 line 1104 and refsect1 </refsect1> ^ ../xml/nm-client.xml:1262: parser error : Opening and ending tag mismatch: refsect1 line 1095 and refentry </refentry> ^ ../xml/nm-client.xml:1263: parser error : Premature end of data in tag refentry line 7 ^ ../libnm-glib-docs.xml:67: element include: XInclude error : could not load ../xml/nm-client.xml, and no fallback was found make[3]: *** [html-build.stamp] Error 6 Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-glib: document some propertiesDan Winship2014-07-256-10/+65
| | | | | | | | Some libnm-glib object properties were only documented in the GParamSpec strings, not via gtk-doc comments, so they became undocumented when the paramspec strings went away. Fix that. (Also fix incorrect gtk-doc syntax with several NMClient properties.)
* ifcfg-rh: fix a crash on setting hostname with SELinux disabled (rh #1122826)Jiří Klimeš2014-07-251-1/+1
| | | | | | | | | | | | | | | | | | When SELinux is disabled, getfscreatecon() fails leaving se_ctx_prev undefined and then later freecon (se_ctx_prev) fails with a crash. Initializing se_ctx_prev to NULL fixes the crash. (It is fine to pass NULL context to setfscreatecon()). Testcase: 1) Enable ifcfg-rh plugin in /etc/NetworkManger/NetworkManger.conf plugins=ifcfg-rh 2) Edit /etc/sysconfig/selinux to contain SELINUX=disabled 3) Reboot 4) Set hostname via nmcli, nmtui or D-Bus SaveHostname() call 5) NM crashes https://bugzilla.redhat.com/show_bug.cgi?id=1122826
* libnm-util: fix enum member names in a gtk-doc commentDan Winship2014-07-231-7/+7
|
* libnm-util: fix gtk-doc syntax in nm-version.h to avoid a warningDan Winship2014-07-231-1/+1
|
* wwan: allow using the default subscription APN (bgo #729665)Dan Williams2014-07-231-2/+2
| | | | | | | | If no APN is specified, passing "" to ModemManager indicates that the connection should use the default subscription APN, which the modem and the network determine themselves. This doesn't work with all modems and operators, but in that case the user can specify the APN.
* wwan: allow completing new GSM connections without an APN (bgo #729665)Simon Farnsworth2014-07-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | In commit 215306f5 [1], NetworkManager was changed to require an APN for GSM connections; previously, an omitted APN was taken as "use the default APN for this device". ModemManager supports this behaviour with an empty APN string; older NetworkManager versions support this behaviour with no APN in the settings. Choose the older NM behaviour, for backwards compatibility. [1] commit 215306f5a1e4dc38ec02a484c31470bb048d668b Author: Dan Williams <dcbw@redhat.com> Date: Mon Jan 10 23:39:12 2011 -0600 core: add AddAndActivate D-Bus method Given connection details, complete the connection as well as possible using the given specific object and device, add it to system settings, and activate it all in one method. Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk> https://bugzilla.gnome.org/show_bug.cgi?id=729665
* merge: add WWAN support for IPv6 (bgo #682623)Dan Williams2014-07-2315-135/+1043
|\
| * wwan: use a shorter DHCP timeoutdcbw/wwan-ipv6Dan Williams2014-07-231-0/+13
| | | | | | | | | | | | | | | | | | With WWAN, the DHCP is all done in modem firmware, and never started until we know we have a successful packet connection to the network. Which means the modem firmware already knows the IP details and is ready to provide them. Furthermore, since the DHCP is done on what is essentially a reliable, wired point-to-point link, we don't have to waste time with retransmits for dropped packets either.
| * dhcp: DHCPv6 OtherConf failures should not be fatalDan Williams2014-07-231-4/+11
| | | | | | | | | | | | | | | | OtherConf implies the address has already been delivered via RA, and possibly DNS too, meaning our IP configuration is already good enough. If nothing on the network bothers to reply to our DHCPv6 Information Requests, let's just run with the config we already have instead of tearing down the whole device.
| * wwan: don't disconnect if nothing to disconnectDan Williams2014-07-231-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | Avoid this error: NetworkManager[25181]: <warn> (cdc-wdm1): Failed to connect 'T-Mobile Internet': Connection requested IPv4 but IPv4 is unsuported by the modem. NetworkManager[25181]: <info> (cdc-wdm1): device state change: prepare -> failed (reason 'modem-init-failed') [40 120 28] ** (NetworkManager:25181): CRITICAL **: mm_modem_simple_disconnect: assertion 'MM_IS_MODEM_SIMPLE (self)' failed self->priv->simple_iface is only valid if stage1/prepare actually completes, so don't try to access it if stage1/prepare failed.
| * core: remove child devices when a parent's ip_iface becomes knownDan Williams2014-07-231-0/+28
| | | | | | | | | | | | | | | | Child devices shouldn't be exposed as real NMDevices (yet) since the configuration and life cycle is controlled by the parent. We already do this if the ip_iface is known when the child device is added, but PPP and other transient interfaces often show up just before we know the parent's ip_iface.
| * wwan: move IP method handling into the modem objectDan Williams2014-07-232-22/+39
| | | | | | | | | | Do it in one place (NMModem) so that NMDeviceBt takes advantage of the same logic that NMDeviceModem used to use.
| * wwan: add IPv6 support for ModemManager1 (bgo #682623)Dan Williams2014-07-231-32/+178
| | | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=682623
| * wwan: add infrastructure for IPv6 config resultsDan Williams2014-07-237-27/+418
| |
| * wwan: clean up and split IP method valuesDan Williams2014-07-233-37/+55
| | | | | | | | | | | | | | | | | | | | Add an 'unknown' value; make the type an enum, and rename it since this enum is private to NetworkManager and abstracts differences in old and new MM. We also need separate methods for IPv4 and IPv6 since they may not use the same mechanism. For example, IPv4 may use DHCP but IPv6 may require static configuration, based on what the modem firmware wants.
| * wwan: read supported IP types from ModemManagerDan Williams2014-07-233-0/+61
| | | | | | | | | | | | Not all modems support IPv6, and to prevent some common failure cases, make sure we don't try to use IPv6 when the modem doesn't support it.
| * ppp: add IPv6 supportDan Williams2014-07-236-36/+226
| | | | | | | | | | | | Add support for IPv6 to the pppd plugin and return the interface identifiers to NetworkManager. Use those to construct the IPv6LL addresses for the PPP interface and the peer.