summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* cli: don't wait for connection change on update failurebg/rh1702203Beniamino Galvani2019-04-231-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://bugzilla.redhat.com/show_bug.cgi?id=1702203
* 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".
| * cli,all: merge branch 'th/strsplit-pt4'Thomas Haller2019-04-187-290/+125
| |\ | | | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/117
| | * cli: use "escaped-tokens" style for splitting "vlan.xgress-priority-map" listThomas Haller2019-04-181-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There should be little difference here, because the priority list is (and was) never serialized with special characters like backslashes or delimiters that require escaping. Likewise, no working code actually tried to set such characters. Still, drop the plain VALUE_STRSPLIT_MODE_STRIPPED and use VALUE_STRSPLIT_MODE_ESCAPED_TOKENS_WITH_SPACES instead. We should have a small set of modes that we use for splitting strings.
| | * cli: cleanup _get_fcn_vlan_xgress_priority_map()Thomas Haller2019-04-181-23/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - merge the pointless helper function vlan_priorities_to_string() into the only caller _get_fcn_vlan_xgress_priority_map(). - minor cleanups, like setting out-is-default if num==0, not based on whether we have a non-empty string. There is not difference in practice, because nm_setting_vlan_get_priority() never fails. Hence they are identical. But nm_setting_vlan_get_priority() has an API that allows it to fail, so we should declare the default depending on the number of vlan priorities. - don't allocate the temporary GString instance if we won't need it. - only append the delimiter if needed, and not truncate it afterwards. It might have even worse performance this way, but it feels more correct to me. - also cache the result of nm_setting_vlan_get_num_priorities(). NMSettingVlan's implementation is horrible and uses a GSList to track the list of priorities. This makes it relatively expensive to call get-num-priorities repeatedly (and pointless).
| | * cli: unify set of characters to tokenize list propertiesThomas Haller2019-04-181-3/+3
| | | | | | | | | | | | | | | | | | the only change in behaviour is for VALUE_STRSPLIT_MODE_MULTILIST. Previously, we would split at " \t,", now we will also split at the white space characters "\n\r\f".
| | * shared: remove unused _nm_utils_escape_plain()/_nm_utils_escape_spaces() APIThomas Haller2019-04-183-190/+0
| | | | | | | | | | | | | | | | | | | | | ... and the "unescape" variants. This is replaced by nm_utils_escaped_tokens_split() and nm_utils_escaped_tokens_escape*() API.
| | * ifcfg-rh: use nm_utils_escaped_tokens* for "MATCH_INTERFACE_NAME"Thomas Haller2019-04-182-7/+8
| | | | | | | | | | | | | | | | | | | | | For one, use NM_ASCII_SPACES as delimiter when reading "MATCH_INTERFACE_NAME". Previously, it was only " \t". I think there is no change in behavior otherwise.
| | * cli: refactor multilist property handling of "match.interface-names"Thomas Haller2019-04-182-23/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had %VALUE_STRSPLIT_MODE_MULTILIST_WITH_ESCAPE, which was used by "match.interface-names". This uses nm_utils_strsplit_set_full() with %NM_UTILS_STRSPLIT_SET_FLAGS_ALLOW_ESCAPING and _nm_utils_unescape_plain(). We want eventually to use nm_utils_escaped_tokens_split() everywhere. We already have %VALUE_STRSPLIT_MODE_ESCAPED_TOKENS, which splits the list at ',' (and strips whitespaces at the around the delimiter). That differs from what %VALUE_STRSPLIT_MODE_MULTILIST_WITH_ESCAPE did, which also considered whitespace a delimiter. So, we need a new mode %VALUE_STRSPLIT_MODE_ESCAPED_TOKENS_WITH_SPACES which replaces the previous mode. Note that the previous implementation did almost the same thing. In fact, I cannot imagine examples where they behaved differently, but my feeling is that there might be some edge cases where this changes behavior.
| | * cli: return early when splitting with %VALUE_STRSPLIT_MODE_STRIPPEDThomas Haller2019-04-181-1/+2
| | | | | | | | | | | | | | | | | | The reminder of the function only does (something akin to) g_strstrip(). As we split the strings are spaces to begin with, there is nothing to strip and we can return right away.
| | * cli: drop unused strsplit_with_escape mode for objlist propertiesThomas Haller2019-04-182-10/+1
| | |
| | * cli: assert for proper escaping when creating objlist stringThomas Haller2019-04-181-16/+36
| | |
| | * cli: default splitting list properties with escaped-tokens styleThomas Haller2019-04-182-12/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | When splitting (and concatenating) list-typed properties, we really should use nm_utils_escaped_tokens_split() and nm_utils_escaped_tokens_escape*(). Make that the default, and mark all properties to opt-in to the legacy behavior.
| | * cli: fix splitting of multilist property in setterThomas Haller2019-04-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The modes VALUE_STRSPLIT_MODE_OBJLIST* and VALUE_STRSPLIT_MODE_MULTILIST* are different. We must use the right mode. For example, _get_fcn_match_interface_name() concatenates the interface-names with space. So, the tokenizer of the setter must also use space as delimiter. VALUE_STRSPLIT_MODE_MULTILIST_WITH_ESCAPE does that correctly, VALUE_STRSPLIT_MODE_OBJLIST_WITH_ESCAPE does not.
| | * cli: fix handling empty match.interface-name propertyThomas Haller2019-04-182-4/+10
| |/
| * platform: merge branch 'th/platform-routing-rules-compare'Thomas Haller2019-04-188-241/+273
| |\ | | | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/115
| | * platform: compare routing rules according to kernel support for FRA_L3MDEVThomas Haller2019-04-181-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Also, in nm_platform_routing_rule_cmp() always compare the routing table field, also if l3mdev is set. For kernel, we cannot set table and l3mdev together, hence such rules don't really exist (or if we try to configure it, it will be rejected by kernel). But as far as nm_platform_routing_rule_cmp() is concerned, if the table is set, always compare it.
| | * platform: compare routing rules according to kernel support for FRA_UID_RANGEThomas Haller2019-04-181-7/+16
| | |
| | * platform: compare routing rules according to kernel support for FRA_IP_PROTOThomas Haller2019-04-181-9/+16
| | | | | | | | | | | | ... and FRA_SPORT_RANGE and FRA_DPORT_RANGE.
| | * platform: compare routing rules according to kernel support for FRA_PROTOCOLThomas Haller2019-04-181-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For routes and routing rules, kernel uses a certain (not stictly defined) set of attributes to decide whether to routes/rules are identical. That is a problem, as different kernel versions disagree on whether two routes/rules are the same (EEXIST) or not. Note that when NetworkManager tries to add a rule with protocol set to anything but RTPROT_UNSPEC, then kernel will ignore the attribute if it doesn't have support for it. Meaning: the added rule will have a different protocol setting then intended. Note that NMPRulesManager will add a rule if it doesn't find it in the platform cache so far. That means, when looking into the platform cache we must ignore or honor the protocol like kernel does. This does not only affect FRA_PROTOCOL, but all attributes where kernel and NetworkManager disagrees. But the protocol is the most prominent one, because the rules tracked by nmp_rules_manager_track_default() specify the protocol.
| | * platform: detect kernel support for FRA_L3MDEVThomas Haller2019-04-183-0/+16
| | |
| | * platform: detect kernel support for FRA_UID_RANGEThomas Haller2019-04-183-0/+16
| | |
| | * platform: detect kernel support for FRA_IP_PROTO, FRA_SPORT_RANGE, ↵Thomas Haller2019-04-183-0/+22
| | | | | | | | | | | | FRA_DPORT_RANGE
| | * platform: detect kernel support for FRA_PROTOCOLThomas Haller2019-04-183-0/+13
| | |
| | * platform: refactor detecting kernel featuresThomas Haller2019-04-188-214/+149
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Next we will need to detect more kernel features. First refactor the handling of these to require less code changes and be more efficient. A plain nm_platform_kernel_support_get() only reqiures to access an array in the common case. The other important change is that the function no longer requires a NMPlatform instance. This allows us to check kernel support from anywhere. The only thing is that we require kernel support to be initialized before calling this function. That means, an NMPlatform instance must have detected support before.
| * libnm-core/tests: fix "-Werror=logical-not-parentheses" warning in ↵Thomas Haller2019-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _sock_addr_endpoint() CC libnm-core/tests/libnm_core_tests_test_general-test-general.o In file included from ../shared/nm-default.h:280:0, from ../libnm-core/tests/test-general.c:24: ../libnm-core/tests/test-general.c: In function _sock_addr_endpoint: ../libnm-core/tests/test-general.c:5911:18: error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses] g_assert (!host == (port == -1)); ^ ../shared/nm-utils/nm-macros-internal.h:1793:7: note: in definition of macro __NM_G_BOOLEAN_EXPR_IMPL if (expr) \ ^ /usr/include/glib-2.0/glib/gmacros.h:376:43: note: in expansion of macro _G_BOOLEAN_EXPR #define G_LIKELY(expr) (__builtin_expect (_G_BOOLEAN_EXPR((expr)), 1)) ^ /usr/include/glib-2.0/glib/gtestutils.h:116:49: note: in expansion of macro G_LIKELY if G_LIKELY (expr) ; else \ ^ ../libnm-core/tests/test-general.c:5911:2: note: in expansion of macro g_assert g_assert (!host == (port == -1)); ^ Fixes: 713e879d769f ('libnm: add NMSockAddrEndpoint API')
| * bridge: merge branch 'bg/bridge-vlan-ranges'Beniamino Galvani2019-04-1819-184/+341
| |\ | | | | | | | | | | | | | | | | | | | | | In some cases it is convenient to specify ranges of bridge vlans, as already supported by iproute2 and natively by kernel. https://bugzilla.redhat.com/show_bug.cgi?id=1652910 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/114
| | * libnm: minor refactoring of _nm_utils_bridge_vlan_verify_list()Thomas Haller2019-04-181-21/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - if there is only one vlan in the list, then we can return success early. That is, because one NMBridgeVlan instance is always valid due to the way how users must use the API to construct the element. - the implementation for check_normalizable is only correct, if there are no duplicate or overlapping ranges. Assert for that. In fact, all callers first check for errors and then for normalizable errors. - avoid duplicate calls to nm_bridge_vlan_get_vid_range(). There are duplicate assertions that we don't need. - only check for pvid once per range. - combine calls to g_hash_table_contains() and g_hash_table_add().
| | * all: use escaped_tokens API for bridge vlansBeniamino Galvani2019-04-185-6/+8
| | |
| | * device: avoid multiple allocations in setting_vlans_to_platform()Thomas Haller2019-04-181-20/+23
| | | | | | | | | | | | | | | | | | | | | We don't need GPtrArray to construct an array of fixed side. Actually, we also don't need to malloc each NMPlatformBridgeVlan element individually. Just allocate one buffer and append them to the end.