summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* contrib/rpm: provide NetworkManager-dispatcherlr/dispatcher-splitLubomir Rintel2019-04-291-0/+2
| | | | | | This is a provide packages that install dispatcher scripts should depend on. It will make it easier to keep track of them and possibly split out the dispatcher into an optional package if not needed.
* contrib/rpm: (trivial) move some %files around, remove a duplicateLubomir Rintel2019-04-291-4/+3
| | | | Just a cosmetic thing.
* dispatcher: look for the scripts in /usr/lib as wellLubomir Rintel2019-04-292-37/+71
| | | | | This makes it possible for packages that ship dispatcher scripts to use the correct location.
* src/dispatcher: do not monitor dispatcher scriptsLubomir Rintel2019-04-261-145/+4
| | | | | | | | | The monitors have been in place since the dispatcher has been introduced. They need the daemon to do extra work know where the files are supposed to be. It seems to me the complexity is not worth it. Let's remove them now, making it easier to modify the dispatcher to look for scripts in other places.
* build: install dispatcher dirs in /usrLubomir Rintel2019-04-262-7/+11
| | | | | | The dispatcher looks there for scripts now. This actually doesn't break the RPM build, since it doesn't mind extra empty directories in buildroot. Good.
* cli,libnm: merge branch 'th/cli-team-cleanup'Thomas Haller2019-04-2526-936/+2080
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/121
| * ifcfg-rh: support serializaing all possible values for ethernet.s390-options ↵Thomas Haller2019-04-252-2/+10
| | | | | | | | | | | | | | | | | | | | | | (OPTIONS) While the keys of s390-options are from a well-behaving set of names (that is enforced by nm_connection_verify()), the values are arbitrary strings. Our settings plugin must be able to express all values of a connection, hence we need to support escapes.
| * libnm: refactor implementation of "ethernet.s390-options" propertyThomas Haller2019-04-256-79/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - the previous implementation of nm_setting_wired_get_s390_option() returned the elements in an arbitrary order (because it just iterated idx times over the unsorted hash table). - the API for "s390-options" suggests both accessing by index and by name. Storing the options in a hash-table is not optimal for lookup by index. It also requires us to sort the elements over and over again. Use instead a sorted array. Note that add/remove of course requires to move the elements (and has thus O(n)). - "s390-options" are very seldomly set. We shouldn't pay the price in every NMSettingWired to allocate a GHashTable and deal with it. - don't assert in nm_setting_wired_add_s390_option() and nm_setting_wired_remove_s390_option() that the key is valid. ifcfg-rh reader understandably does not want to implement additional logic to pre-validate the key, so any invalid keys would trigger an assertion failure. We have verify() for this purpose.
| * libnm/keyfile: implement ethernet.s390-options in keyfileThomas Haller2019-04-252-2/+204
| | | | | | | | | | | | | | | | Currently, nm_setting_wired_get_s390_option() returns the key in an undefined order. Hence, the keyfile writer and the test need to awkwardly sort the keys first. That will be solved better in the next commit, when nm_setting_wired_get_s390_option() returns the items sorted by key.
| * shared,libnm-core: use nm_utils_named_value_list_sort()Thomas Haller2019-04-253-9/+2
| |
| * shared: add nm_utils_named_value_list_*() utilsThomas Haller2019-04-252-0/+114
| | | | | | | | | | nm_utils_named_value_list_find(), nm_utils_named_value_list_sort(), and nm_utils_named_value_list_is_sorted().
| * cli: drop GValue transform functions for strdict and implement it in ↵Thomas Haller2019-04-252-45/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | _get_fcn_gobject_impl() The only remaining GValue transform function was from GHashTable (of (str,str) type) to string. Drop that too, and implement the conversion in _get_fcn_gobject_impl(). Note that there are few GObject properties of type GHashTable and most of them implement their own logic. This only applies to "802-3-ethernet.s390-options". Also, always sort the keys. Otherwise, the output is not stable.
| * cli: drop GValue transformation of GBytes to string and implement bytes ↵Thomas Haller2019-04-252-67/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getter via _get_fcn_gobject_impl() The g_value_register_transform_func() for handling GBytes was not actually used. All properties of type G_TYPE_BYTES have their explit handler how to convert bytes to string. That is good, because the implementation there was very bad (it did not honor pretty/parsable get-type). Also, merge _get_fcn_gobject_bytes() into _get_fcn_gobject_impl(). We already have a generic handler that handles properties solely based on the GObject type: _get_fcn_gobject_impl(). Just let it also handle bytes. It's better to have fewer handlers, if they don't need special context.
| * cli: drop GValue transform function for G_TYPE_STRV to G_TYPE_STRINGThomas Haller2019-04-252-30/+31
| | | | | | | | | | | | It's ugly to modify the global behavior of glib to convert between types. Instead, _get_fcn_gobject_impl() is perfectly capable to implement converting a strv array to string.
| * cli: cleanup and fix handling of unset/empty "ipv4.dns-options"Thomas Haller2019-04-255-565/+654
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "ipv4.dns-options" and "ipv6.dns-options" are special, in that they can be either unset/default or an empty list of options. That means, nmcli must treat these two options differently. For the (terse) getter, it returns "" for default and " " for empty. The setter must likewise support and distingish between these two cases. Cleanup the handling of such options. This only applies to properties of type "multilist". Hence, add multilist.clear_emptyunset_fcn() handler that indicates that the property is of that kind. Try: nmcli connection modify "$PROFILE" ipv4.dns-options '' nmcli connection modify "$PROFILE" ipv4.dns-options ' ' and compare the output: nmcli connection show "$PROFILE" | sed -n '/ipv4.dns-options/ s/.*/<\0>/p' nmcli -t connection show "$PROFILE" | sed -n '/ipv4.dns-options/ s/.*/<\0>/p' nmcli -o connection show "$PROFILE" | sed -n '/ipv4.dns-options/ s/.*/<\0>/p'
| * cli: add RETURN_STR_TEMPORARY() macro to "clients/common/nm-meta-setting-desc.c"Thomas Haller2019-04-251-0/+12
| | | | | | | | Will be used next.
| * cli: use escaped-tokens style for team-link-watcher list propertiesThomas Haller2019-04-251-3/+1
| | | | | | | | | | | | | | | | | | | | The link-watcher properties are not expected to contain any special values that require escaping. Hence, change the tokenizing from plain splitting at ',' to escaped-tokens style is likely to not affect any existing setups. Still, all our properties should be handled the same way (including a tokenizing which allows escaping to represent every possible value).
| * cli: refactor team-link-watcher to/from stringsThomas Haller2019-04-254-128/+336
| | | | | | | | | | | | | | | | Stricter parsing of the string: - reject attributes that don't make sense depending on the type. - reject duplicate attributes.
| * shared: fix to/from string of vlanid and missed-max values for NMTeamLinkWatcherThomas Haller2019-04-252-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vlanid and missed-max values have non-zero default values. That is what nm_utils_team_link_watcher_from_string() honors. Note that nm_utils_team_link_watcher_to_string() must omit printing the value only if it's the default value too. Otherwise, these values are not preserved during a to string conversion and back. Maybe a better fix would be to always print the values, regardless of the default value. But arguably, that is quite ugly because in most cases we don't want to cluter the string output with values that are left at the default.
| * shared/tests: add test for NMTeamLinkWatcher to/from stringThomas Haller2019-04-251-0/+220
| |
| * shared/tests: add tests for libnm-core-auxThomas Haller2019-04-256-28/+120
| | | | | | | | | | | | | | | | | | | | These tests cannot (easily) be under "shared/nm-libnm-core-aux/tests" because libnm/libnm-core requires code under shared while "nm-libnm-core-aux" requires libnm/libnm-core. With autotools that is not problem, but with meson we include sub directories in a particular order and there is no way to foward declare stuff (AFAIK). To avoid the circular dependency, add the tests to "clients/common/tests", which is always built last.
| * shared: fix missing space printing "send-always" flag of NMTeamLinkWatcherThomas Haller2019-04-251-1/+1
| |
| * cli,shared: move NMTeamLinkWatcher to/from string function to ↵Thomas Haller2019-04-253-154/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | "nm-libnm-core-aux.h" to/from string functions are useful. We should be able to reuse them. Move them to their own location. Also, it moves independent code out of "clients/common/nm-meta-setting-desc.c" which is already one of the largest source files we have. Also, it makes the code unit-testable, which is obviously required as the code has bugs.
| * shared: add "nm-libnm-core-aux/nm-libnm-core-aux.h"Thomas Haller2019-04-254-1/+51
|/
* manager: merge branch 'bg/sw-device-sleep-rh1701585'Beniamino Galvani2019-04-241-7/+13
|\ | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1701585 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/123
| * manager: unmanage software devices when networking gets disabledBeniamino Galvani2019-04-241-3/+9
| | | | | | | | | | | | If a user disables networking, we consider that as an indication that also software devices must be disconnected. OTOH, we don't want to destroy them for external events as a system suspend.
| * manager: clear unmanaged-sleeping flag on software devices on resumeBeniamino Galvani2019-04-241-4/+4
|/ | | | | | | When networking is disabled at NM startup we unmanage all devices (including software ones) due to SLEEPING. After networking gets enabled again we must clear the unmanaged-sleeping flag on software devices.
* cli: don't wait for connection change on update failureBeniamino Galvani2019-04-241-2/+4
| | | | | | | | | | | | When saving a connection, we wait the connection-changed signal before proceeding to ensure that the remote connection is up to date. However, no signal is emitted if the update fails and so we shouldn't wait for it. Fixes: a370faeb59a9 ('cli: wait for changed signal after updating a connection'): https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/124 https://bugzilla.redhat.com/show_bug.cgi?id=1702203
* README: Update git clone commandTill Maas2019-04-241-2/+2
| | | | https://github.com/NetworkManager/NetworkManager/pull/349
* tools: fix out-of-tree build test "tools/check-docs.sh" for duplicate ↵Thomas Haller2019-04-231-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | generated sources When we do an in-tree-build with autotools and an out-of-tree build with meson (all in the same source directory), then we have the following files: libnm-core/nm-core-enum-types.h libnm/nm-enum-types.h build/libnm-core/nm-core-enum-types.h build/libnm/nm-enum-types.h This caused "tools/check-docs.sh" for `ninja -C build test` to fail, because the files are detected twice: --- command --- /data/src/NetworkManager/tools/check-docs.sh /data/src/NetworkManager /data/src/NetworkManager/build --- stderr --- 8a9 > nm-core-enum-types 38a40 > nm-enum-types *** Error: libnm classes not included in docs/libnm/libnm-docs.xml *** -------
* tools: cleanup path variable in "tools/check-docs.sh"Thomas Haller2019-04-231-7/+7
| | | | | - don't append the path separator to the SOURCEDIR variable. Instead, use the path separator when we need it.
* release: bump version to 1.19.1-dev after 1.18.0 release1.19.1-devThomas Haller2019-04-21315-78498/+2738
|\ | | | | | | | | | | | | | | | | | | After 1.18.0 is released, merge it back into master so that 1.18.0 is part of the history of master. That means, $ git log --first-parent master will also traverse 1.18.0 and 1.18-rc*. Also bump the micro version to 1.19.1-dev to indicate that this is after 1.18.0 is out.
| * libnm: add missing NM_AVAILABLE_IN_1_18 markers to nm_ip_routing_rule_*() APIThomas Haller2019-04-211-0/+2
| |
| * gitlab-ci: install glib2-doc via "contrib/fedora/REQUIRED_PACKAGES"Thomas Haller2019-04-202-0/+6
| | | | | | | | | | | | | | | | | | | | | | We also generate a source tarball and artifact it. Hence, we need proper gtk-doc links. This requires files in /usr/share/gtk-doc/html for adding cross links. Install glib2-doc package. Note that in containers dnf is configured to not install documentation files. We need to override that.
| * po: updated Panjabi (pa) TranslationA S Alam2019-04-201-964/+831
| | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/120
| * gitlab-ci: don't use "test && cmd" in build stepThomas Haller2019-04-201-2/+2
| | | | | | | | | | | | | | | | We don't want stesp to return an error, which is what "test && cmd" does, if the test evaluates to false. Instead, use "! test || cmd" which has more the semantics that we want.
| * libnm: don't return deep-copied strv array from ↵Thomas Haller2019-04-202-7/+5
| | | | | | | | | | | | | | | | nm_tc_qdisc_get_attribute_names() Most of the caller won't require a deep-clone of the attribute names. Likely, the fetch the name, so they can lookup the attributes. In that common case, there is no need to clone the strings themself.
| * libnm-core: avoid cloning attributes of NMTCQdisc/NMTCAction to convert to ↵Thomas Haller2019-04-205-31/+29
| | | | | | | | string
| * gitlab-ci: build release tarball and artifact itThomas Haller2019-04-191-6/+13
| |
| * gitlab-ci: build on Ubuntu 16.04, 18.04 and Debian stretch (9), testing, sidThomas Haller2019-04-193-28/+152
| | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/119
| * contrib/rpm: Provide list of units to %systemd_postunTill Maas2019-04-181-2/+4
| | | | | | | | | | | | | | %systemd_postun is meant to be run with arguments and Fedora Rawhide seems to enforce this now. Therefore provide the units there, too. https://github.com/NetworkManager/NetworkManager/pull/348
| * build/meson: fix location of introspection filesThomas Haller2019-04-182-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With glib < 2.51.3, gdbus-codegen does not understand "--output-directory" [1]. Hence, the generated files are like "build/dbus-org.freedesktop.NetworkManager.Device.WifiP2P.xml" instead of "build/introspection/dbus-org.freedesktop.NetworkManager.Device.WifiP2P.xml" But gnome.gdbus_codegen() returns a path as if it would be inside "build/introspection". Hack around that, by patching the correct path otherwise. This is still ugly, because repeated "ninja -C build" calls will always try to rebuild this target (because the wrong file name is considered). See also [2]. [1] https://gitlab.gnome.org/GNOME/glib/commit/ee09bb704fe9ccb24d92dd86696a0e6bb8f0dc1a [2] https://github.com/mesonbuild/meson/blob/2e93ed58c30d63da8527ff16375ff9e0642e7533/mesonbuild/modules/gnome.py#L1170
| * platform: fix nm_platform_lnk_gre_to_string() for tap linksThomas Haller2019-04-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Why didn't we get a compiler warning about this bug? At least clang (3.8.0-2ubuntu4, Ubuntu 16.04) warns: CC src/platform/src_libNetworkManagerBase_la-nm-platform.lo ../src/platform/nm-platform.c:5389:14: error: data argument not used by format string [-Werror,-Wformat-extra-args] lnk->remote ? nm_sprintf_buf (str_remote, " remote %s", nm_utils_inet4_ntop (lnk->remote, str_remote1)) : "", ^ Fixes: 4c2862b9589c ('platform: add gretap tunnels support')
| * shared: merge branch 'th/shared-library-refactoring'Thomas Haller2019-04-18158-314/+520
| |\ | | | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/113
| | * build/meson: rename "nm_core_dep" to "libnm_core_dep"Thomas Haller2019-04-1817-25/+25
| | | | | | | | | | | | | | | The library is called "libnm_core". So the dependency should be called "libnm_core_dep", like in all other cases.
| | * shared: build helper "libnm-libnm-core-{intern|aux}.la" library for libnm-coreThomas Haller2019-04-1846-91/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "libnm-core" implements common functionality for "NetworkManager" and "libnm". Note that clients like "nmcli" cannot access the internal API provided by "libnm-core". So, if nmcli wants to do something that is also done by "libnm-core", , "libnm", or "NetworkManager", the code would have to be duplicated. Instead, such code can be in "libnm-libnm-core-{intern|aux}.la". Note that: 0) "libnm-libnm-core-intern.la" is used by libnm-core itsself. On the other hand, "libnm-libnm-core-aux.la" is not used by libnm-core, but provides utilities on top of it. 1) they both extend "libnm-core" with utlities that are not public API of libnm itself. Maybe part of the code should one day become public API of libnm. On the other hand, this is code for which we may not want to commit to a stable interface or which we don't want to provide as part of the API. 2) "libnm-libnm-core-intern.la" is statically linked by "libnm-core" and thus directly available to "libnm" and "NetworkManager". On the other hand, "libnm-libnm-core-aux.la" may be used by "libnm" and "NetworkManager". Both libraries may be statically linked by libnm clients (like nmcli). 3) it must only use glib, libnm-glib-aux.la, and the public API of libnm-core. This is important: it must not use "libnm-core/nm-core-internal.h" nor "libnm-core/nm-utils-private.h" so the static library is usable by nmcli which couldn't access these. Note that "shared/nm-meta-setting.c" is an entirely different case, because it behaves differently depending on whether linking against "libnm-core" or the client programs. As such, this file must be compiled twice.
| | * shared: move "nm-dbus-compat.h" header to "nm-std-aux/nm-dbus-compat.h"Thomas Haller2019-04-1813-12/+12
| | |
| | * shared: move most of "shared/nm-utils" to "shared/nm-glib-aux"Thomas Haller2019-04-1891-149/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the files under "shared/nm-utils" we build an internal library that provides glib-based helper utilities. Move the files of that basic library to a new subdirectory "shared/nm-glib-aux" and rename the helper library "libnm-core-base.la" to "libnm-glib-aux.la". Reasons: - the name "utils" is overused in our code-base. Everything's an "utils". Give this thing a more distinct name. - there were additional files under "shared/nm-utils", which are not part of this internal library "libnm-utils-base.la". All the files that are part of this library should be together in the same directory, but files that are not, should not be there. - the new name should better convey what this library is and what is isn't: it's a set of utilities and helper functions that extend glib with funcitonality that we commonly need. There are still some files left under "shared/nm-utils". They have less a unifying propose to be in their own directory, so I leave them there for now. But at least they are separate from "shared/nm-glib-aux", which has a very clear purpose.
| | * shared: move udev helper to separate directory "shared/nm-udev-aux"Thomas Haller2019-04-1812-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | We built (among others) two libraries from the sources in "shared/nm-utils": "libnm-utils-base.la" and "libnm-utils-udev.la". It's confusing. Instead use directories so there is a direct correspondence between these internal libraries and the source files.
| | * shared: split C-only helper "shared/nm-std-aux" utils out of "shared/nm-utils"Thomas Haller2019-04-1816-19/+68
| |/ | | | | | | | | | | | | | | | | | | | | | | | | "shared/nm-utils" contains general purpose utility functions that only depend on glib (and extend glib with some helper functions). We will also add code that does not use glib, hence it would be good if the part of "shared/nm-utils" that does not depend on glib, could be used by these future projects. Also, we use the term "utils" everywhere. While that covers the purpose and content well, having everything called "nm-something-utils" is not great. Instead, call this "nm-std-aux", inspired by "c-util/c-stdaux".