summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* dhcp: fix handling of failure eventsbg/rh1573780Beniamino Galvani2018-06-011-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | DHCPv4 can fail for two reasons: (a) the client failed to contact server and to get an initial lease (b) the client failed to renew the lease after it was successfully acquired For (a) the client generates a TIMEOUT event, for (b) an EXPIRED event. Currently we fail the IP method immediately after (a), but this doesn't work well when the carrier flickers and we restart the client because if the server goes temporarily down, the IP method fails and DHCP is never restarted. Let's change this, and determine whether to fail IP configuration only by looking at the current IP state: when it's IP_CONF then we are getting the initial lease and a failure means that IP configuration must fail; otherwise any other state means that the lease expired or could not be renewed and thus we keep the client running for the grace period. https://bugzilla.redhat.com/show_bug.cgi?id=1573780
* shared/trivial: add code comment to explain NMUtilsEnumValueInfo consistency ↵Thomas Haller2018-06-011-0/+9
| | | | rules
* settings: fix plugins loadingBeniamino Galvani2018-06-011-5/+5
| | | | | | Since load_plugin() modifies the list, we must pass its address. Fixes: fd86a1aebbcdbfd9854ca5f9755e8e2fe90e5f1d
* man: clarify main.rc-manager=file behavior for resolv.conf as dangling symlinkThomas Haller2018-06-012-2/+7
| | | | | | | It's not clear whether this was desired behavior. However, it was behavior for a long time, so we probably should not change it. Just document what happens with dangling symlinks.
* dns: move local variables to inner scope in update_resolv_conf()Thomas Haller2018-06-011-2/+2
|
* release: bump version to 1.11.4 (development)1.11.4-devLubomir Rintel2018-05-312-2/+2
|
* release: update NEWS for a development snapshotLubomir Rintel2018-05-311-0/+53
|
* test: don't assert on the tun link being up to date prior to upping itLubomir Rintel2018-05-311-0/+8
| | | | | | | Fixes the test run with: NMTST_SEED_RAND=502735495 src/platform/tests/test-link-linux \ -p /link/software/detect/tun/external
* all: merge branch 'th/build-cleanup-defines'Thomas Haller2018-05-3151-747/+626
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/126
| * build/meson: fix meson build for shared filesThomas Haller2018-05-317-77/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The files in shared/nm-utils are not compiled as one static library, instead each subproject that needs (parts of) them, re-compiles the files individually. The major reason for that is, because we might have different compile flags, depending on whether we build libnm-core or libnm-util/libnm-glib. Actually, I think that is not really the case, and maybe this should be refactored, to indeed build them all as a static library first. Anyway, libnm-util, libnm-glib, clients' common lib, they all need a different set of shared files that they should compile. Refactor "shared/meson.build" to account for that and handle it like autotools does. Another change is, that "shared_c_siphash_dep" no longer advertises "include_directories: include_directories('c-siphash/src')". We don't put c-siphash.h into the include search path. Users who need it, should include it via "#include <c-siphash/src/c-siphash.h>". The only exception is when building shared_n_acd library, which is not under our control.
| * all: replace systemd's siphash24 with c-siphashThomas Haller2018-05-3110-267/+101
| | | | | | | | | | | | | | | | | | | | | | | | Originally, we used "nm-utils/siphash24.c", which was copied from systemd's source tree. It was both used by our own NetworkManager code, and by our internal systemd fork. Then, we added "shared/c-siphash" as a dependency for n-acd. Now, drop systemd's implementation and use c-siphash also for our internal purpose. Also, let systemd code use c-siphash, by patching "src/systemd/src/basic/siphash24.h".
| * build: use default NM_BUILD_* defines for testsThomas Haller2018-05-3133-392/+402
| | | | | | | | | | | | | | | | | | Use two common defines NM_BUILD_SRCDIR and NM_BUILD_BUILDDIR for specifying the location of srcdir and builddir. Note that this is only relevant for tests, as they expect a certain layout of the directories, to find files that concern them.
| * build: define NM_BUILD_SRCDIR and NM_BUILD_BUILDDIRThomas Haller2018-05-312-0/+10
| |
| * build: use common locale directory for building nmtuiThomas Haller2018-05-311-1/+1
| | | | | | | | All other places use $(nmlocaledir) variable.
| * build: unifiy specifying locale directory defineThomas Haller2018-05-319-15/+17
| |
| * build: don't add shared/nm-utils directory to include search pathThomas Haller2018-05-314-2/+8
|/ | | | | | | | | | | | All users are supposed to include files from nm-utils by fully specifying the path. -I.*shared/nm-utils is wrong. Only, systemd code likes to include "siphash24.h" directly. Instead of adding "-Ishared/nm-utils" to the search path, add an intermediary header to sd-adapt. Note, that in the meantime we anyway should rework siphash24 to use shared/c-siphash instead. This also fixes build for meson, which was broken recently.
* platform/wifi: do not double-free nl_msgAlfonso Sánchez-Beato2018-05-311-6/+2
| | | | | In some places, there was an unneeded call to nlmsg_free () for messages declared with the nm_auto_nlmsg macro.
* merge: branch 'lr/setting-plugin-props-cleanup'Lubomir Rintel2018-05-319-299/+97
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/119
| * settings-plugin: drop all propertieslr/setting-plugin-props-cleanupLubomir Rintel2018-05-318-194/+0
| | | | | | | | They're not useful and just add extra noise.
| * settings: do away with plugin capabilitiesLubomir Rintel2018-05-311-7/+9
| | | | | | | | | | There's exactly one and not too useful -- only used only in one spot where we can do hapilly without it.
| * settings: don't use the name property to disambiguate pluginsLubomir Rintel2018-05-311-19/+12
| | | | | | | | | | | | Use the path instead. This drop an useless use of the "name" property, which is, coincidentally also wrong. (We use "ibft" in the plugin path whereas the property is set to "iBFT".)
| * settings: simplify the settings plugin loading log lineLubomir Rintel2018-05-311-10/+1
| | | | | | | | | | | | | | | | It's actually annoying, useless and wraps over even on wide displays. Let's make it consistent with the log line we use for device plugins. Also, this drops the last use of the "info" property and one useless use of the "name" property.
| * settings: refactor load_plugins() to remote a harmful use of gotoLubomir Rintel2018-05-311-71/+77
|/ | | | | Turn the plugin loading logic between load_plugin: and next: into a subroutine.
* platform: sort known IPv6 addresses by scope before a syncBeniamino Galvani2018-05-301-0/+26
| | | | | | | | | | The order we want to enforce is only among addresses with the same scope, as the kernel always keeps addresses sorted by scope. Therefore, apply the same sorting to known addresses, so that we don't try to unnecessary change the order of addresses with different scopes. https://bugzilla.redhat.com/show_bug.cgi?id=1578668
* shared: don't use nm_str_hash() in "nm-enum-utils.c"Thomas Haller2018-05-301-1/+1
| | | | | | | | | | | | | This was only used for some extra assertions. It' is not essential. If this would be for real usage, we should add a dependancy so that nm-utils/nm-enum-utils.c requires nm-hash-utils.h. But as it is, this is not necessary. This fixes build for meson, which wrongly tries to build nm-enum-utils.c for libnm-util, but then fails to include nm-hash-utils.c. That should be fixed independently. Fixes: 84a6eff106732f9754896c53599f907f811aed8e
* shared: don't allow aliases re-numbering in _nm_utils_enum_from_str_full()Thomas Haller2018-05-291-25/+73
| | | | | | | | | | | | | | | | | | | | | For _nm_utils_enum_to_str_full(), we always first look whether we have an alias/nick for the numeric value, and preferably use that. That makes a lot of sense, as it allows the caller to provide better names (aliases), which are preferred over the name from the GLib type. It renames the numeric value. For the reverse conversion, this makes less sense. A name should have a unique numeric value. That is, we should not use one name that maps to a different numeric value based on value_infos and GLib type. IOW, we should not re-number names. Add an assertion that we don't provide such a value_infos parameter, that conflicts with names from GLib type. Also, although the case where GLib type and value_infos disagree is now forbidden by an assert, reorder the statements in _nm_utils_enum_from_str_full() too. There is no difference in practice, but it mirros what we do in the to-str case.
* shared/trivial: rename local variable classThomas Haller2018-05-291-21/+21
| | | | | There is no real problem with using "class" in C. However, it would be a keyword in C++. Just avoid it, and use "klass" instead.
* libnm/tests: fix crash in testsThomas Haller2018-05-291-0/+1
| | | | Fixes: daf4ba43da702e182df3c90b969c1d8fd762185b
* shared: fix parsing aliases for flags in _nm_utils_enum_from_str_full()Thomas Haller2018-05-292-2/+3
| | | | | | Otherwise, the last alias overwrites previous values. Fixes: b9fa0e0a195e9cf7363b563cca7ffec4b5016afd
* shared/tests: extend tests for nm_utils_enum_from_str()Thomas Haller2018-05-291-70/+184
|
* n-acd: merge branch 'bg/n-acd-fixes-rh1578675'Beniamino Galvani2018-05-296-22/+47
|\ | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1578675
| * device: vlan: restart ARP announcement after we change MACBeniamino Galvani2018-05-293-4/+6
| | | | | | | | | | After the parent MAC address changes and we update the VLAN MAC, also restart ARP announcement to notify neighbors of the new address mapping.
| * core: vlan: avoid unneeded castsBeniamino Galvani2018-05-291-5/+5
| |
| * n-acd: slightly improve loggingBeniamino Galvani2018-05-291-1/+5
| | | | | | | | If timeout is 0 we don't really do a probe. Also, log the timeout.
| * n-acd: better handle interfaces going temporarily downBeniamino Galvani2018-05-291-11/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NM sometimes brings an interface temporarily down (for example to change a VLAN MAC to align it to the parent interface's one). When this happens, any recv() or send() in n-acd fails, the n-acd instance is reset to the initial state and a DOWN event is reported to the manager, which currently does not handle it. The result is an inconsistent state. There is no simple way of dealing with the DOWN event in the manager. What we can do instead is to: - ignore errors during recv() because there is really nothing we can do, except for waiting timeouts to expire; - during probe, ignore errors during send() so that we don't exceed the probe timeout; - during announcement, retry after a send() error to ensure we send all 3 announcements. https://bugzilla.redhat.com/show_bug.cgi?id=1578675
| * n-acd: use RFC 5227 timeout for announcementsBeniamino Galvani2018-05-292-1/+10
|/ | | | | | | When doing announcements, use the the timeout specified by RFC 5227. Note that timeout_multiplier might be 0. This aligns behavior to upstream version of n-acd.
* policy: don't block connection if device is goneAleksander Morgado2018-05-281-3/+5
| | | | | | | | | | | | | If the active connection is deactivated because the device is gone, don't block autoconnection. Otherwise, whenever the device comes back (e.g. maybe it was reset in the middle of a connection attempt), the autoconnection logic won't be triggered, as the settings are still blocked. I'm able to reproduce this by performing a WWAN modem reset in the middle of a connection attempt. https://github.com/NetworkManager/NetworkManager/pull/121
* clients/tests: run nmcli commands in parallelThomas Haller2018-05-28111-194/+261
| | | | | | | | | | | | | | | | | Most nmcli calls from clients/tests don't change the server's state. Hence, they can easily run in parallel. Run tests in parallel. No longer handle one nmcli invocation after the other. Instead, spawn groups of processes in parallel, and track the pending jobs. Only at certain synchronization points we call self.async_wait() to wait for all previous jobs to complete. This reduces the test time on my machine from 7 to 3 seconds. Arguably, that matters less during a full `make check -j 8`, because the entire set of tests anyway takes longer than 7 seconds. So when running the entire test suite, the machine is kept busy anyway. It matters however for manual invocations.
* all: merge branch 'th/per-host-stable-id'Thomas Haller2018-05-289-78/+143
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/117
| * all: add stable-id specifier "${DEVICE}"Thomas Haller2018-05-286-20/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new stable-id specifier "${DEVICE}" to explicitly declare that the connection's identity differs per-device. Note that for settings like "ipv6.addr-gen-mode=stable" we already hash the interface's name. So, in combination with addr-gen-mode, using this specifier has no real use. But for example, we don't do that for "ipv4.dhcp-client-id=stable". Point being, in various context we possibly already include a per-device token into the generation algorithm. But that is not the case for all contexts and uses. Especially the DHCPv4 client identifier is supposed to differ between interfaces (according to RFC). We don't do that by default with "ipv4.dhcp-client-id=stable", but with "${DEVICE}" can can now be configured by the user. Note that the fact that the client-id is the same accross interfaces, is not a common problem, because profiles are usually restricted to one device via connection.interface-name.
| * device: hash a per-host key for ipv4.dhcp-client-id=stableThomas Haller2018-05-283-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise, the generated client-id depends purely on the profile's stable-id. It means, the same profile (that is, either the same UUID or same stable-id) on different hosts will result in identical client-ids. That is clearly not desired. Hash a per-host secret-key as well. Note, that we don't hash the interface name. So, activating the profile on different interfaces, will still yield the same client-id. But also note, that commonly a profile is restricted to one device, via "connection.interface-name". Note that this is a change in behavior. However, "ipv4.dhcp-client-id=stable" was only added recently and not yet released. Fixes: 62a78639797244ef49f439ba2d8bd3332d31585b
| * core: let nm_utils_secret_key_read() handle failures internallyThomas Haller2018-05-282-50/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and add nm_utils_secret_key_get() to cache the secret-key, to only obtain it once. nm_utils_secret_key_read() is not expected to fail. However, in case of an unexpected error, don't propagate the error to the caller, but instead handle it internally. That means, in case of error: - log a warning within nm_utils_secret_key_read() itself. - always return a generated secret-key. In case of error, the key won't be persisted (obviously). But the caller can ignore the error and just proceed with an in-memory key. Hence, also add nm_utils_secret_key_get() to cache the key. This way, we only try to actually generate/read the secret-key once. Since that might fail and return an in-memory key, we must for future invocations return the same key, without generating a new one.
| * core: ensure NUL terminated secret_key bufferThomas Haller2018-05-281-1/+5
| | | | | | | | | | | | | | The secret_key is binary random data, so one shouldn't ever use it as a NUL terminated string directly. Still, just ensure that the entire buffer is always NUL terminated.
| * libnm: expose _bin2str() helper function as internal APIThomas Haller2018-05-282-6/+7
| |
| * libnm: allow nm_utils_hwaddr_valid() of length zeroThomas Haller2018-05-281-2/+4
|/ | | | | | nm_utils_hwaddr_valid() is used for validating strings. It should not assert against calling it with an empty string "". That is just an invalid hwaddr.
* rpm/build.sh: suggest dnf builddep after BUILDTYPE=SRPMlr/python3Lubomir Rintel2018-05-281-1/+4
| | | | Convenient for copy & paste.
* rpm: prefer python3Lubomir Rintel2018-05-281-0/+7
| | | | | | | From Fedora 28 on we can build without Python 2. That is good, because it's eventually going to be removed. Based on a change in Fedora dist-git by Iryna Shcherbina.
* cli: fix property matchingBeniamino Galvani2018-05-289-17/+120
| | | | | | | | | | @ret was not initialized when there was only one partial match. Also, refactor the code to return all matching values. Fixes: 3fd9bf9d7d9fc0290fd25f709b60a3a8f5c7e334 https://github.com/NetworkManager/NetworkManager/pull/123
* tests: implement Update2() in NetworkManager stubBeniamino Galvani2018-05-281-1/+6
|
* clients/tests: refactor by moving replace-text helper functionThomas Haller2018-05-281-31/+31
| | | | Have less logic in TestNmcli.