summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* clients/tests: generate Makefile.am for expected filesThomas Haller2018-05-27107-218/+246
| | | | | | | | | | | | | | | | The developer can re-generate .expected files with $ NM_TEST_REGENERATE=1 ./clients/tests/test-client.py Note that these files are also dist-ed, so that the tests also work from a source-tarball. For that, we need to add them to EXTRA_DIST. Previously, this was done manually in the base Makefile.am file. This was cumbersome, because when adding a new test, the developer would need to manually add the files. Now, let the test (with NM_TEST_REGENERATE=1) also generate a makefile part.
* core/dhcp: merge branch 'th/dhcp-cleanup'Thomas Haller2018-05-269-117/+133
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/122
| * dhcp: refactor dhclient_start() to use cleanup attributeThomas Haller2018-05-261-45/+45
| |
| * dhcp: cache errno in nm_dhcp_client_stop_existing() before using itThomas Haller2018-05-262-6/+10
| |
| * dhcp: use NMIPConfig type for argument of nm_dhcp_client_set_state()Thomas Haller2018-05-263-14/+13
| |
| * dhcp: use cleanup attribute in nm_dhcp_client_handle_event()Thomas Haller2018-05-261-22/+19
| | | | | | | | and use NMIPConfig type.
| * dhcp: minor cleanup initializing name of leasefile for NMDhcpDhclintThomas Haller2018-05-261-17/+11
| |
| * core: let NM_IS_IP_CONFIG() check for expected addr-familyThomas Haller2018-05-263-8/+14
| | | | | | | | Still unused...
| * shared: minor cleanup of nm_utils_get_start_time_for_pid()Thomas Haller2018-05-262-7/+22
| |
| * dhcp: fix leaking error in dhclient_start()Thomas Haller2018-05-261-0/+1
|/ | | | Fixes: 1b1b4bd91c29425c25e8e979cd77b7a67deb9bf5
* cli: avoid bogus line seprator in pretty-outputThomas Haller2018-05-255-66/+5
| | | | | | | | | | | | | This bug resulted in spurious lines with "--pretty --mode tabular", whenever nmc_print() was called with multiple rows. Currently, the only case where this was visible was with: $ nmcli --pretty general permissions (note that "--mode tabular" is the default). Fixes: 16299e5ac0a8882e13d42122278013b74bc6d34d
* cli/tests: add test for output of `nmcli general permissions`Thomas Haller2018-05-2598-78/+826
|
* ppp: merge branch 'th/ppp-stop'Thomas Haller2018-05-2511-204/+352
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/113
| * core: add and use NM_SHUTDOWN_TIMEOUT_MS as duration that we plan for shutdownThomas Haller2018-05-252-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nm_ppp_manager_stop() wants to ensure that the pppd process is really gone. For that it uses nm_utils_kill_child_async() to first send SIGTERM, and sending SIGKILL after a timeout. Later, we want to fix shutdown of NetworkManager to iterate the mainloop during shutdown, so that such operations are still handled. However, we can only delay shutdown for a certain time. After a timeout (NM_SHUTDOWN_TIMEOUT_MS plus NM_SHUTDOWN_TIMEOUT_MS_GRACE) we really have to give up and terminate. That means, the right amount of time between sending SIGTERM and SIGKILL is exactly NM_SHUTDOWN_TIMEOUT_MS. Hopefully that is of course sufficient in the first place. If not, send SIGKILL afterwards, and give a bit more time (NM_SHUTDOWN_TIMEOUT_MS_GRACE) to reap the child. And if all this time is still not enough, something is really odd and we abort waiting, with a warning in the logfile. Since we don't properly handle shutdown yet, the description above is not really true. But with this patch, we fix it from point of view of NMPPPManager.
| * ppp-manager: rework stopping NMPPPManager by merging async/sync methodsThomas Haller2018-05-259-157/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, there were two functions nm_ppp_manager_stop_sync() and nm_ppp_manager_stop_async(). However, stop-sync() would still kill the process asynchronously (with a 2 seconds timeout before sending SIGKILL). On the other hand, stop-async() did pretty much the same thing as sync-code, except also using the GAsyncResult. Merge the two functions. Stopping the instance for the most part can be done entirely synchrnous. The only thing that is asynchronous, is to wait for the process to terminate. For that, add a new callback argument to nm_ppp_manager_stop(). This replaces the GAsyncResult pattern. Also, always ensure that NetworkManager runs the mainloop at least as long until the process really terminated. Currently we don't get that right, and during shutdown we just stop iterating the mainloop. However, fix this from point of view of NMPPPManager and register a wait-object, that later will correctly delay shutdown. Also, NMDeviceWwan cared to wait (asynchronously) until pppd really terminated. Keep that functionality. nm_ppp_manager_stop() returns a handle that can be used to cancel the asynchrounous request and invoke the callback right away. However note, that even when cancelling the request, the wait-object that prevents shutdown of NetworkManager is kept around, so that we can be sure to properly clean up.
| * ppp-manager/trivial: rename variables holding self pointersThomas Haller2018-05-251-64/+64
| | | | | | | | | | | | We usually structure our code in a (pseudo) object oriented way. It makes sense to call the variable for the target object "self", it is more familiar and usually done.
| * ppp-manager: refactor killing pppd process by using _ppp_kill() functionThomas Haller2018-05-251-24/+25
| | | | | | | | | | | | | | | | | | | | - add callback arguments to _ppp_kill(). Although most callers don't care, it makes it more obvious that this kills the process asynchronously. - the call to nm_utils_kill_child_async() is complicated, with many arguments. Only call it from one place, and re-use the simpler wrapper function _ppp_kill() everywhere.
| * core: add nm_shutdown_register_watchdog() for marking object to wait for ↵Thomas Haller2018-05-252-0/+101
|/ | | | | | | | | | | | | | | shutdown Eventually we should do a coordinated shutdown when NetworkManager exits. That is a large work, ensuring that all asynchronous actions are cancellable (in time), and that we wait for all pending operations to complete. Add a function nm_shutdown_register_watchdog(), so that objects can register themselves, to block shutdown until they are destroyed. It's not yet used, because actually iterating the mainloop during shutdown can only be done, once the code is prepared to be ready for that. But we already need the function, so that we can refactor individual parts of the code, in preparation of using it in the future.
* clients: fix an error message in case of property ambiguityLubomir Rintel2018-05-241-4/+6
| | | | | | | | | | | | Before: $ nmcli c modify Dukkha ipv4.ignore no Error: invalid property 'ignore': 'ignore' is ambiguous (ignore-auto-routes x (null)). After: $ nmcli c modify Dukkha ipv4.ignore no Error: invalid property 'ignore': 'ignore' is ambiguous (ignore-auto-routes x ignore-auto-dns).
* tests: merge branch 'th/cli-tests'Thomas Haller2018-05-24105-1336/+2200
|\
| * clients/tests: drop duplicate tests for German translationThomas Haller2018-05-24122-3137/+1818
| | | | | | | | | | | | call_nmcli_l() would test for 3 languages: 'C', 'de', and 'pl'. There is no fundamental difference between 'de' and 'pl', so there is no need to test for two languages.
| * clients/tests: test nmcli output for active-connection state DEACTIVATINGThomas Haller2018-05-2429-0/+833
| |
| * clients/tests: load libnm via GObject introspectionThomas Haller2018-05-24101-100/+113
| | | | | | | | | | We will use it, and it must be available anyway, because the stub server also requires it.
| * clients/tests: add SetProperties operation to test-networkmanager-service.py ↵Thomas Haller2018-05-24102-105/+165
| | | | | | | | | | | | | | stub It is a hook to set one or several D-Bus properties at once. Properties that are to be set-able, have to be whitelisted in the stub.
| * tests: don't return path name from obj.get_managed_ifaces() in ↵Thomas Haller2018-05-241-7/+4
| | | | | | | | test-networkmanager-service.py
| * clients/tests: test nmcli output for multiple activation of same profileThomas Haller2018-05-24102-118/+1078
| | | | | | | | | | | | | | | | | | | | | | Activate the same profile on two devices. Arguably, real NetworkManager (currently) does not allow that. But the D-Bus API is fine with having multiple ActiveConnections for one SettingsConnection. So, also the client should do something sensible. Also, later we will add wildcard support to NetworkManager, which means that a profile can be active multiple times (simultaneously).
| * clients/tests: print active fields during `nmcli con show`Thomas Haller2018-05-2411-126/+438
| |
| * clients/tests: add extra_env argument to call_nmcli()Thomas Haller2018-05-2479-80/+88
|/ | | | | | | | | | | This is purely for (manual) printf debugging. Hence, it is unused in the commited code. The point is, to add printf statements to nmcli or libnm, like if (getenv ("MY_HACK1")) { ... and trigger it from test-client.py via self.call_nmcli(..., extra_env = { 'MY_HACK1': '1' } )
* shared/trivial: fix typo on commentFrancesco Giudici2018-05-241-1/+1
|
* dispatcher: rework creating dispatcher environmentThomas Haller2018-05-242-350/+374
| | | | | | | | | | | | | | - don't use GSList as intermediate data type to construct the environment, especially when all we want is to get a strv array at the end. This reverts the order of elements compared to previously. - add and use helper methods _items_add_*() which assert against sensible input. - merge IPv4 and IPv6 implementations for creating the environment. https://github.com/NetworkManager/NetworkManager/pull/112
* build: merge branch 'th/contrib-rpm-use-gnutls'Thomas Haller2018-05-244-25/+24
|\ | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1581693
| * contrib/rpm: use gnutls crypto library instead of NSS on rhel-8 and fedora-29Thomas Haller2018-05-242-0/+14
| | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1581693
| * build: print used crypto library in ./configure result outputThomas Haller2018-05-241-19/+7
| | | | | | | | And cleanup handling --with-crypto in configure.ac.
| * libnm-util/crypto: fix harmless compiler warningThomas Haller2018-05-241-6/+3
|/ | | | | | | | | libnm-util/crypto_gnutls.c: In function crypto_encrypt: libnm-util/crypto_gnutls.c:245:8: error: variable salt_len set but not used [-Werror=unused-but-set-variable] gsize salt_len; ^~~~~~~~ See-also: 312c72f7617d974abd9de4218f1e9b920a6a999c
* doc: add units to nm_device_get_mtu()Thomas Haller2018-05-231-1/+1
|
* doc: add units to some libnm (and libnm-glib) function docsHarry Mallon2018-05-235-13/+13
| | | | https://mail.gnome.org/archives/networkmanager-list/2018-May/msg00027.html
* active-connection: fix build with clang-6.0Lubomir Rintel2018-05-211-1/+2
| | | | | | | | | | | | | | | | | | | | glib 2.56's g_steal_pointer() won't tolerate a function pointer in place of a gpointer. CC src/src_libNetworkManager_la-nm-active-connection.lo src/nm-active-connection.c:1017:17: error: pointer type mismatch ('NMActiveConnectionAuthResultFunc' (aka 'void (*)(struct _NMActiveConnection *, int, const char *, void *)') and 'gpointer' (aka 'void *')) [-Werror,-Wpointer-type-mismatch] result_func = g_steal_pointer (&priv->auth.result_func); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/glib-2.0/glib/gmem.h:200:6: note: expanded from macro 'g_steal_pointer' (0 ? (*(pp)) : (g_steal_pointer) (pp)) ^ ~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. There's just a single spot we use it that way, so it's perhaps better to work around the warning instead of disabling it.
* tests: run the nmcli test with $PYTHON we autoconf'dLubomir Rintel2018-05-211-0/+1
| | | | | | | | | | | Avoids an annoying warning in Fedora: |DEPRECATION WARNING: python2 invoked with /usr/bin/python. Use /usr/bin/python3 or /usr/bin/python2 /usr/bin/python will be removed or switched to Python 3 in the future. Also allows the user to override the Python version that's actually used.
* build/meson: fix building internal systemd libraryThomas Haller2018-05-191-0/+1
| | | | Fixes: d577888d8f73e62866dfa70d4dd14b35373e4e7d
* systemd: merge branch systemd into masterThomas Haller2018-05-1842-193/+855
|\
| * systemd: update code from upstream (2018-05-18)Thomas Haller2018-05-1840-193/+847
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a direct dump from systemd git. ====== SYSTEMD_DIR=../systemd COMMIT=7fbb5dd5e2cc733a83af813b13e859a8172a6046 ( cd "$SYSTEMD_DIR" git checkout "$COMMIT" git reset --hard git clean -fdx ) git ls-files :/src/systemd/src/ \ :/shared/nm-utils/siphash24.c \ :/shared/nm-utils/siphash24.h \ :/shared/nm-utils/unaligned.h | \ xargs -d '\n' rm -f nm_copy_sd() { mkdir -p "./src/systemd/$(dirname "$1")" cp "$SYSTEMD_DIR/$1" "./src/systemd/$1" } nm_copy_sd_shared() { mkdir -p "./shared/nm-utils/" cp "$SYSTEMD_DIR/$1" "./shared/nm-utils/${1##*/}" } nm_copy_sd "src/basic/alloc-util.c" nm_copy_sd "src/basic/alloc-util.h" nm_copy_sd "src/basic/async.h" nm_copy_sd "src/basic/escape.c" nm_copy_sd "src/basic/escape.h" nm_copy_sd "src/basic/ether-addr-util.c" nm_copy_sd "src/basic/ether-addr-util.h" nm_copy_sd "src/basic/extract-word.c" nm_copy_sd "src/basic/extract-word.h" nm_copy_sd "src/basic/fileio.c" nm_copy_sd "src/basic/fileio.h" nm_copy_sd "src/basic/fd-util.c" nm_copy_sd "src/basic/fd-util.h" nm_copy_sd "src/basic/fs-util.c" nm_copy_sd "src/basic/fs-util.h" nm_copy_sd "src/basic/hash-funcs.c" nm_copy_sd "src/basic/hash-funcs.h" nm_copy_sd "src/basic/hashmap.c" nm_copy_sd "src/basic/hashmap.h" nm_copy_sd "src/basic/hexdecoct.c" nm_copy_sd "src/basic/hexdecoct.h" nm_copy_sd "src/basic/hostname-util.c" nm_copy_sd "src/basic/hostname-util.h" nm_copy_sd "src/basic/in-addr-util.c" nm_copy_sd "src/basic/in-addr-util.h" nm_copy_sd "src/basic/io-util.c" nm_copy_sd "src/basic/io-util.h" nm_copy_sd "src/basic/list.h" nm_copy_sd "src/basic/log.h" nm_copy_sd "src/basic/macro.h" nm_copy_sd "src/basic/mempool.h" nm_copy_sd "src/basic/mempool.c" nm_copy_sd "src/basic/parse-util.c" nm_copy_sd "src/basic/parse-util.h" nm_copy_sd "src/basic/path-util.c" nm_copy_sd "src/basic/path-util.h" nm_copy_sd "src/basic/prioq.h" nm_copy_sd "src/basic/prioq.c" nm_copy_sd "src/basic/process-util.h" nm_copy_sd "src/basic/process-util.c" nm_copy_sd "src/basic/random-util.c" nm_copy_sd "src/basic/random-util.h" nm_copy_sd "src/basic/refcnt.h" nm_copy_sd "src/basic/set.h" nm_copy_sd "src/basic/signal-util.h" nm_copy_sd_shared "src/basic/siphash24.c" nm_copy_sd_shared "src/basic/siphash24.h" nm_copy_sd "src/basic/socket-util.c" nm_copy_sd "src/basic/socket-util.h" nm_copy_sd "src/basic/sparse-endian.h" nm_copy_sd "src/basic/stat-util.c" nm_copy_sd "src/basic/stat-util.h" nm_copy_sd "src/basic/stdio-util.h" nm_copy_sd "src/basic/string-table.c" nm_copy_sd "src/basic/string-table.h" nm_copy_sd "src/basic/string-util.c" nm_copy_sd "src/basic/string-util.h" nm_copy_sd "src/basic/strv.c" nm_copy_sd "src/basic/strv.h" nm_copy_sd "src/basic/time-util.c" nm_copy_sd "src/basic/time-util.h" nm_copy_sd "src/basic/umask-util.h" nm_copy_sd_shared "src/basic/unaligned.h" nm_copy_sd "src/basic/utf8.c" nm_copy_sd "src/basic/utf8.h" nm_copy_sd "src/basic/util.c" nm_copy_sd "src/basic/util.h" nm_copy_sd "src/libsystemd-network/arp-util.c" nm_copy_sd "src/libsystemd-network/arp-util.h" nm_copy_sd "src/libsystemd-network/dhcp6-internal.h" nm_copy_sd "src/libsystemd-network/dhcp6-lease-internal.h" nm_copy_sd "src/libsystemd-network/dhcp6-network.c" nm_copy_sd "src/libsystemd-network/dhcp6-option.c" nm_copy_sd "src/libsystemd-network/dhcp6-protocol.h" nm_copy_sd "src/libsystemd-network/dhcp-identifier.c" nm_copy_sd "src/libsystemd-network/dhcp-identifier.h" nm_copy_sd "src/libsystemd-network/dhcp-internal.h" nm_copy_sd "src/libsystemd-network/dhcp-lease-internal.h" nm_copy_sd "src/libsystemd-network/dhcp-network.c" nm_copy_sd "src/libsystemd-network/dhcp-option.c" nm_copy_sd "src/libsystemd-network/dhcp-packet.c" nm_copy_sd "src/libsystemd-network/dhcp-protocol.h" nm_copy_sd "src/libsystemd-network/lldp-internal.h" nm_copy_sd "src/libsystemd-network/lldp-neighbor.c" nm_copy_sd "src/libsystemd-network/lldp-neighbor.h" nm_copy_sd "src/libsystemd-network/lldp-network.c" nm_copy_sd "src/libsystemd-network/lldp-network.h" nm_copy_sd "src/libsystemd-network/network-internal.c" nm_copy_sd "src/libsystemd-network/network-internal.h" nm_copy_sd "src/libsystemd-network/sd-dhcp6-client.c" nm_copy_sd "src/libsystemd-network/sd-dhcp6-lease.c" nm_copy_sd "src/libsystemd-network/sd-dhcp-client.c" nm_copy_sd "src/libsystemd-network/sd-dhcp-lease.c" nm_copy_sd "src/libsystemd-network/sd-ipv4ll.c" nm_copy_sd "src/libsystemd-network/sd-ipv4acd.c" nm_copy_sd "src/libsystemd-network/sd-lldp.c" nm_copy_sd "src/libsystemd/sd-event/sd-event.c" nm_copy_sd "src/libsystemd/sd-id128/id128-util.c" nm_copy_sd "src/libsystemd/sd-id128/id128-util.h" nm_copy_sd "src/libsystemd/sd-id128/sd-id128.c" nm_copy_sd "src/shared/dns-domain.c" nm_copy_sd "src/shared/dns-domain.h" nm_copy_sd "src/systemd/_sd-common.h" nm_copy_sd "src/systemd/sd-dhcp6-client.h" nm_copy_sd "src/systemd/sd-dhcp6-lease.h" nm_copy_sd "src/systemd/sd-dhcp-client.h" nm_copy_sd "src/systemd/sd-dhcp-lease.h" nm_copy_sd "src/systemd/sd-event.h" nm_copy_sd "src/systemd/sd-ndisc.h" nm_copy_sd "src/systemd/sd-id128.h" nm_copy_sd "src/systemd/sd-ipv4acd.h" nm_copy_sd "src/systemd/sd-ipv4ll.h" nm_copy_sd "src/systemd/sd-lldp.h"
* | active-connection: fix harmless typoFrancesco Giudici2018-05-181-1/+1
| |
* | devices/wwan: Stop PPP manager in deactivate_cleanup()Frederic Danis2018-05-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When ModemManager exits, pppd is not killed due to nm_exported_object not unexported (ppp_manager refcount = 2). Call to nm_ppp_manager_stop_sync() allows to correctly clean ppp_manager before calling g_clear_object(), as this is done in nm-device-ethernet.c and nm-device-adsl.c. [thaller@redhat.com: rebase and adjust patch] https://bugzilla.gnome.org/show_bug.cgi?id=796108 https://mail.gnome.org/archives/networkmanager-list/2018-May/msg00015.html
* | dispatcher: fix leak in construct_device_dhcp4_items()Thomas Haller2018-05-161-10/+10
| | | | | | | | Fixes: c86d0b47229c036e1c1c39e81d7d125dcd8e74b9
* | dispatcher: extra sanitize names of environment variablesThomas Haller2018-05-161-2/+26
| | | | | | | | | | The DHCP options should already be sanitized. Still, make sure we don't create a bogus environment.