summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | initrd: fix error reporting on bad netmaskLubomir Rintel2019-07-021-1/+1
|/ / | | | | | | It says the address is bad, but what is wrong is the mask.
* | po: update Chinese Taiwan (zh_TW) translationHsiu-Ming Chang2019-06-291-1417/+1420
| | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/190
* | settings,libnm: merge branch 'th/settings-seen-bssid-and-timestamps'Thomas Haller2019-06-2827-157/+382
|\ \ | | | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/191
| * | settings: use nm_connection_to_dbus_full() to avoid cloning the connection ↵Thomas Haller2019-06-281-40/+33
| | | | | | | | | | | | during GetSettings()
| * | libnm: implement serialization options (inject timestamp/seen-bssids) for ↵Thomas Haller2019-06-283-1/+69
| | | | | | | | | | | | nm_connection_to_dbus_full()
| * | libnm: add nm_connection_to_dbus_full() with options argumentThomas Haller2019-06-2820-46/+100
| | | | | | | | | | | | No options are implemented yet.
| * | settings: cleanup handling of seen-bssids list in NMSettingsConnectionThomas Haller2019-06-283-36/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - most connections are not Wi-Fi connections and thus don't have a seen-bssids list. Only create the seen_bssids hash when required. This avoids allocating the hash in common cases and avoids checking the hash for the content (which is often empty). - nm_settings_connection_get_seen_bssids() should return a sorted list. Leaving the sort order undefined is ugly. - in try_fill_ssid_for_hidden_ap(), we need to check all NMSettingsConnection instances whether they know this bssid. Reorder the checks, to first call nm_settings_connection_has_seen_bssid(), which is faster and in most cases returns a negative result (shortcutting the rest).
| * | libnm: track wifi.seen-bssids in a GPtrArray instead of a GSListThomas Haller2019-06-281-41/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GPtrArray allows direct lookup by index. Since the NMSettingWireless API is based on lookup by index, this is a common operation. Note that nm_setting_wireless_add_seen_bssid() is still O(n), meaning to add n elements, it takes O(n^2). That's not great but no worse than before. The cases where GSList is the best choice for a data type are few.
| * | shared: add nm_utils_strv_dup() utilThomas Haller2019-06-282-0/+58
| | |
| * | shared: add nm_c_list_free_all() macroThomas Haller2019-06-281-0/+10
|/ /
* | clients: fix printing hexadecimal enum valuesBeniamino Galvani2019-06-271-2/+2
| | | | | | | | | | | | Use the 'x' conversion specifier for hexadecimal numbers. Fixes: f53218ed7cd7 ('cli: add property type for enum and showcase for ipv6.addr-gen-mode'):
* | dhcp: systemd: relicense as LGPLBeniamino Galvani2019-06-271-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | Soon a new DHCP backend will be added that will take code from the internal one. Change its license to LGPL so that the whole new backend code can also be LGPL, which is the preferred license for new NetworkManager code. Acked-by: Dan Williams <dcbw@redhat.com> Acked-by: Dan Winship <danw@redhat.com> Acked-by: Lubomir Rintel <lkundrak@v3.sk> Acked-by: Thomas Haller <thaller@redhat.com>
* | core: add and use nm_keep_alive_destroy()Thomas Haller2019-06-273-2/+23
| | | | | | | | | | | | | | | | | | | | | | When we are done with a NMKeepAlive instance, we always should do three things: - unset the owner - disarm (freeze) the keep-alive - give up our reference. Add and use nm_keep_alive_destroy() that does this.
* | settings: merge branch 'th/various-settings-cleanup-3'Thomas Haller2019-06-2627-196/+365
|\ \ | | | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/187
| * | tools: export more symbols from NetworkManager binary to pluginsth/various-settings-cleanup-3Thomas Haller2019-06-261-1/+1
| | | | | | | | | | | | | | | Plugins also may use nmtst_*() functions (when built with --with-more-asserts) or c_list_*(). Whitelist them too.
| * | ifcfg-rh: add allow_filename_cb() argument to write-ifcfg-rh functionThomas Haller2019-06-265-21/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function determines the filename automatically, but we need to blacklist certain names. That is, because NetworkManager keeps a list of loaded files in memory. When writing a new file, we really want to choose a filename that is not yet taken. For that we must not only consider files on disk, but also files that existed on the last time of loading.
| * | ifcfg-rh: cleanup utils_detect_ifcfg_path()Thomas Haller2019-06-261-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | - avoid cloing the basename. Determining the basename can be done conveniently with strrchr(). - use cleanup macro for temporary variable. - while in practice it should not happen, check that the colon in the name of alias file names is not followed by another '/'.
| * | settings: cache agent and system secrets in a GVariant onlyThomas Haller2019-06-261-76/+61
| | | | | | | | | | | | We don't need the full NMConnection.
| * | manager: don't consider by-user change flag for creating unrealized deviceThomas Haller2019-06-261-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This effectively reverts commit [1]. The by-user argument is not very clear what it means. Is a "nmcli connection load $FILENAME" a user-action? How about reload? I don't know whether the problem that this was supposed to fix is still present. But in any case, the condition here seems not right. It's already hard to understand when and how we generate unrealized devices. If the condition from commit [1] should be prevented, then it must happen somehow differently. In the example, the offending connection is a generated volatile profile with the device being sys-face-state "external". Of course, we should not generate devices for such profiles nor autoactivating them. So adding a device for a volatile connection is always wrong. Don't do that, which should avoid the original problem. [1] commit a8a4eb14183b ('manager: don't create the virtual devices on all connection changes')
| * | core: ensure normalized connection during add-and-activateThomas Haller2019-06-263-2/+4
| | | | | | | | | | | | | | | | | | | | | nm_connection_verify() returns success for fully valid (normalized) connections and also connections that are NM_SETTING_VERIFY_NORMALIZABLE. We really want to fully normalize the profiles during add-and-activate.
| * | settings: reorder checks in _delete_volatile_connection_do() to perform ↵Thomas Haller2019-06-261-2/+2
| | | | | | | | | | | | | | | | | | | | | cheaper check first Checking whether a settings connection is still tracked is a simple c_list_is_empty(). It's faster, so do it first.
| * | settings: use NMCListElem instead of DeleteVolatileConnectionData for ↵Thomas Haller2019-06-261-18/+6
| | | | | | | | | | | | | | | | | | | | | tracking connections to delete For tracking a CList of one pointer we have NMCListElem API. We don't need to implement our own struct to hold the list pointers and the data pointer.
| * | settings: don't implement settings plugins as singletonsThomas Haller2019-06-264-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The settings plugins are created by NMSettings when the plugin gets loaded. There is no need for these instances to be singletons or to have a singleton getter. Also, while in practice we create a settings plugin instance of each type only once, there is nothing that would prevent creating multiple instances. Hence, having a singleton getter is not right. What is however useful, is to track them and block shutdown via nm_shutdown_wait_obj_register*(). While the actual waiting is not yet implemented, we should mark the plugin instances to block shutdown (in the future).
| * | core: add flag to nm_shutdown_wait_obj_register_full() for freeing allcated ↵Thomas Haller2019-06-262-16/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | message string In fact, nm_shutdown_wait_obj_register*() API is still not implemented and registering an object has no effect currently. That is, blocking shutdown and waiting for instances to be destroyed during shutdown is not yet implemented. Still, we already implement the API so that components can register themself to block the shutdown. The point is of course, that the callers already use this API, although it's not yet implemented. Anyway, sometimes the message string is not static. Add an option to pass an allocated string and let the string be destroyed when no longer needed.
| * | libnm: fix setting error for nm_connection_update_secrets()Thomas Haller2019-06-262-10/+23
| | | | | | | | | | | | | | | | | | | | | By convention, a function that indicates failure *MUST* set an error. Also, an error can only be set once.
| * | libnm: workaround assertion failure for nmtst_connection_assert_unchanging() ↵Thomas Haller2019-06-263-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when disposing connection nmtst_connection_assert_unchanging() registers to the changed signals and asserts that they are not invoked. The purpose is that sometimes we want to keep a reference to an NMConnection and be sure that it does not get modified. This allows everybody to keep a reference to the very same connection instance without cloning it -- provided they too promise not to change it. This assert is to ensure that. Note that NMSimpleConnection.dispose() clears the secrets and thus upon destruction the assertion fails. At that point, the assertion is no longer relevant, because the purpose was to ensure that no alive instances gets modified. While destroying the instance, it's fine to modify it (nobody should have a reference to it anymore). This avoids the assertion failure when destroying a NMSimpleConnection with secrets that is set with nmtst_connection_assert_unchanging().
| * | shared: add nm_clear_error() and patch g_clear_error() to use this inlinable ↵Thomas Haller2019-06-261-0/+24
| | | | | | | | | | | | variant
| * | shared/glib: unconditionally redefine g_object_ref()/g_object_ref_sink() as ↵Thomas Haller2019-06-261-2/+10
| | | | | | | | | | | | typesafe macro
| * | shared: add nm_utils_file_stat() utilThomas Haller2019-06-262-0/+27
| | | | | | | | | | | | | | | A small convenience function to call stat(). The difference is that the function returns an error code.
| * | shared: add nm_utils_hashtable_same_keys() utilThomas Haller2019-06-262-0/+32
| | |
| * | shared: allow nm_c_list_move_*() API also to move from one list to anotherThomas Haller2019-06-261-2/+26
| | | | | | | | | | | | | | | | | | Previously, nm_c_list_move_*() only allowed to move element inside the same list. Relax that, it works just the same list to move the element from one list into a different list.
| * | CONTRIBUTING: update section about assertions in NetworkManagerThomas Haller2019-06-261-17/+32
|/ /
* | device: set IPv6 token only when necessaryBeniamino Galvani2019-06-261-3/+11
| | | | | | | | | | | | | | | | Setting the IPv6 token triggers a new router solicitation from kernel and so we should avoid when not strictly necessary. https://mail.gnome.org/archives/networkmanager-list/2019-May/msg00004.html https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/179
* | contrib/checkpatch: allow empty lines within continuationsLubomir Rintel2019-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This chunk from nm-device.c is, in fact, okay: |<-tab->nm_assert ( !new_config |<-tab-> || ( new_config |<-tab-> && ({ |<-tab-> int ip_ifindex = ... empty line -> | |<-tab-> ( ip_ifindex > 0 |<-tab-> && ip_ifindex == ... |<-tab-> })));
* | contrib/checkpatch: be a bit stricter about whitespaceLubomir Rintel2019-06-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | In continations (that use spaces for alignment), don't allow the number of leading tabs to change. Previously only removal of tabs was disallowed, but addition doesn't make sense either, as only spaces should be used for further alignemnt. This catches situations like this: |<-tab->all_work_and_no_play (makes, |<-tab-> jack, |<-tab-><-tab-> a dull boy);
* | contrib/checkpatch: discourage g_assert*()Lubomir Rintel2019-06-251-0/+1
| |
* | core: avoid plain pointer values in logging outputThomas Haller2019-06-252-3/+3
| | | | | | | | | | | | | | | | | | Logging pointer values is useful to identify the object in the logging message. But plain pointer values also can be used to defeat ASLR and should not be logged. Instead, print NM_HASH_OBFUSCATE_PTR() value, which is a 64 bit number based on the pointer value and some random seed. A minor problem is that there is still the chance of duplicates, albeit small.
* | CONTRIBUTING: reword "novel contributions" to "new contributions"Thomas Haller2019-06-241-1/+1
| | | | | | | | | | The meaning of "novel" and "new" here is the same, but "novel" als has a meaning related to patents. So avoid that confusion.
* | settings/ibft: merge branch 'th/drop-ibft-settings-plugin'Thomas Haller2019-06-2035-1597/+16
|\ \ | | | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/186
| * | settings: drop ibft settings pluginth/drop-ibft-settings-pluginThomas Haller2019-06-2035-1597/+16
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | The functionality of the ibft settings plugin is now handled by nm-initrd-generator. There is no need for it anymore, drop it. Note that ibft called iscsiadm, which requires CAP_SYS_ADMIN to work ([1]). We really want to drop this capability, so the current solution of a settings plugin (as it is implemented) is wrong. The solution instead is nm-initrd-generator. Also, on Fedora the ibft was disabled and probably on most other distributions as well. This was only used on RHEL. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1371201#c7
* | shared/tests: add test for nm_utils_bin2hexstr_full()Thomas Haller2019-06-191-0/+82
| |
* | shared: fix nm_utils_bin2hexstr_full() for buffers of length zeroThomas Haller2019-06-191-4/+9
| |
* | connectivity: merge branch 'bg/concheck-issue181'Beniamino Galvani2019-06-183-27/+105
|\ \ | | | | | | | | | | | | | | | Don't start connectivity check on unconfigured devices. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/181
| * | Revert "Coerce connectivity "LIMITED" to "NONE" when device is disconnected"Thomas Haller2019-06-181-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NMConnectivity can now distinguish between LIMITED and NONE connectivity and it does so based on whether IP addresses and routes are configured. Previously, NMConnectivity would not differenciate between limited and no connectivity, which is why NMDevice added some additional logic on top to coerce LIMITED to NONE (if the device is not logically connected). But note that the connectivity state (whether a network is reachable on an interface) depends on what is configured in kernel and whether the internet is reachable on that interface. It does not depend on the logical device state. On the other hand, whether the device is configured in a manner to have connectivity depends on the logical state of the device (as NetworkManager is configuring the device). So, in many cases, the logical state and the connectivity state agree now, but for the right reasons. This reverts commit 4c4dbcb78d5b9427434c46c6952d6518b2e66562.
| * | connectivity: make platform argument to nm_connectivity_check_start() optionalThomas Haller2019-06-181-12/+15
| | | | | | | | | | | | | | | The platform is used to detect whether to skip the connectivity check right away. It should be an optional argument, so one could avoid this pre-check.
| * | connectivity: simplify passing result to idle handlerThomas Haller2019-06-181-13/+12
| | |
| * | connectivity: remove unused error varialbe in _idle_cb()Thomas Haller2019-06-181-10/+2
| | |
| * | device: don't start connectivity check on unconfigured devicesBeniamino Galvani2019-06-183-1/+93
|/ / | | | | | | | | | | | | | | | | | | | | If the interface has no carrier, no addresses or no routes there is no point in starting a connectivity check on it because it will fail. Moreover, doing the check on a device without routes causes the addition of a negative entry in the ARP table for each of the addresses associated with the connectivity check host; this can lead to poor network performances. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/181
* | build/autotools: generate "config-extra.h" via makefile "config-extra.h.mk"Lubomir Rintel2019-06-172-28/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the code that generates "config-extra.h" changes, we want to regenerate the file. Move that code to a separate makefile so we can add a dependency. Otherwise, we'd had to depend on "Makefile", which itself is generated by Makefile.am. Also, depend on "config.h" to regenerate it when ./configure runs and touches that header. This may not cover all cases where ./configure's configuration changes and a regeneration would be due. But such is life. Also, most components depend on this header, so let various .dirstamp files depend on it, so we are sure to build this first. That because, autotools generates dependencies for header files automatically, but that requires that the header file exist. Such automatic dependencies don't work out-of-the-box for generated headers. Co-authored-by: Thomas Haller <thaller@redhat.com>
* | build/autotools: depend "config-extra.h" on "config.h"Thomas Haller2019-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | "config-extra.h" is really just like "config.h", except it works around some limitations of autoconf. If we depend on "Makefile", any changes to "Makefile.am" will cause a full rebuild. We want to avoid that. Instead, depend on "config.h". That one only changes when configure runs again. And that's the better dependancy, because "config-extra.h" is generated based on informations generated by configure (despite being generated by "Makefile").