summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* manager: match device type when removing an ip interfaceLubomir Rintel2017-10-301-0/+2
| | | | Otherwise we might end up removing a wrong device of a same name.
* utils: don't assume a device with master won't have IP configurationLubomir Rintel2017-10-301-20/+12
| | | | | Whether the ip[46]-config exists is a better way, and we already check that.
* core: avoid coverity warning in device factory's _add_factory() (3)Thomas Haller2017-10-301-4/+5
| | | | | | | | | | 2. NetworkManager-1.9.2/src/devices/nm-device-factory.c:312: returned_pointer: Assigning value from "g_slist_append(list, g_object_ref(factory))" to "list" here, but that stored value is overwritten before it can be used. Fixes: 98afc76184502d8e19092d631efb07091be81af2 Fixes: 449940af1d8e8c996e65e266407d857680fc4a9b
* ifcfg: fix invalid free in parse_route_line()Thomas Haller2017-10-301-4/+4
| | | | | | Cannot free NM_PTRARRAY_EMPTY(). Discovered by coverity. Fixes: 6d675a943b99d0ed5ff9c8360dcc485174a41401
* device: workaround coverity warningThomas Haller2017-10-301-6/+12
| | | | | | | | Coverity doesn't like this. Refactor a bit, hoping that it fares better. 1. Defect type: ASSERT_SIDE_EFFECT 1. NetworkManager-1.9.2/src/devices/nm-device.c:10226: assignment_where_comparison_intended: Assignment "ip_ifindex = nm_device_get_ip_ifindex(self)" has a side effect. This code will work differently in a non-debug build. 2. NetworkManager-1.9.2/src/devices/nm-device.c:10226: remediation: Did you intend to use a comparison ("==") instead?
* core: avoid coverity warning in device factory's _add_factory() (2)Thomas Haller2017-10-301-1/+1
| | | | | | | | | 2. NetworkManager-1.9.2/src/devices/nm-device-factory.c:312: returned_pointer: Assigning value from "g_slist_append(list, g_object_ref(factory))" to "list" here, but that stored value is overwritten before it can be used. Fixes: 98afc76184502d8e19092d631efb07091be81af2
* core: avoid coverity warning in device factory's _add_factory()Thomas Haller2017-10-301-1/+1
| | | | | | | 2. NetworkManager-1.9.2/src/devices/nm-device-factory.c:312: returned_pointer: Assigning value from "g_slist_append(list, g_object_ref(factory))" to "list" here, but that stored value is overwritten before it can be used.
* core: workaround coverity/compiler warning about tautological compare in ↵Thomas Haller2017-10-301-3/+7
| | | | | | | | | | nm_log_ptr() Coverity claims: 1. NetworkManager-1.9.2/src/devices/team/nm-device-team.c:303: unsigned_compare: This greater-than-or-equal-to-zero comparison of an unsigned value is always true. "0U <= LOGL_DEBUG".
* platform: remove unreachable code from nmp_cache_lookup_link_full()Thomas Haller2017-10-301-3/+0
| | | | | | If @ifname is set, we above lookup by name (nmp_lookup_init_link_by_ifname) and set ifname to NULL. Hence, inside the loop, the check for ifname is never true.
* ifcfg-rh: avoid Unreachable coverity warning in readerThomas Haller2017-10-301-6/+6
| | | | | | | The loops never run more then once. unreachable: Since the loop increment "iter++;" is unreachable, the loop body will never execute more than once.
* wifi: refactor nm_wifi_utils_level_to_quality() not to assertThomas Haller2017-10-301-3/+1
| | | | | Apparantly, the assert might fail (on i386?). Unclear why that would possibly happen. Anyway, replace the assert.
* wifi/tests: add test whether nm_wifi_utils_level_to_quality() is in rangeThomas Haller2017-10-301-0/+24
|
* systemd: avoid coverity warning about DeadcodeThomas Haller2017-10-301-1/+7
| | | | | | | | | | | Coverity is unhappy about comparing the literal LOG_DEBUG value: 1. Defect type: CONSTANT_EXPRESSION_RESULT 1. NetworkManager-1.9.2/src/systemd/src/libsystemd/sd-event/sd-event.c:2652: result_independent_of_operands: "7 >= (_level & 7)" is always true regardless of the values of its operands. This occurs as the logical first operand of "?:". Work around by instead using an inline function.
* all: avoid coverity warnings about "Missing Initialization"Thomas Haller2017-10-302-2/+2
| | | | | | | | | | | | | 31. NetworkManager-1.9.2/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c:974: uninit_use_in_call: Using uninitialized value "contents_rest" when calling "__strtok_r_1c". 33. NetworkManager-1.9.2/src/nm-core-utils.c:1957: uninit_use: Using uninitialized value "s". 148. NetworkManager-1.9.2/src/nm-core-utils.c:1924: uninit_use_in_call: Using uninitialized value "s" when calling "nm_strstrip_avoid_copy".
* libnm: avoid unnecessary copies accessing NMIPRoute's attributesThomas Haller2017-10-301-5/+5
| | | | | | | | | | We want to support large number of routes. Reduce the number of copies, by adding internal accessor functions. Also, work around a complaint from coverity: 46. NetworkManager-1.9.2/libnm-core/nm-utils.c:1987: dereference: Dereferencing a null pointer "names".
* all: avoid coverity warnings about "Wrong Check of Return Value"Thomas Haller2017-10-305-11/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | 30. NetworkManager-1.9.2/src/settings/plugins/keyfile/nms-keyfile-writer.c:218: check_return: Calling "g_mkdir_with_parents" without checking return value (as is done elsewhere 4 out of 5 times). 25. NetworkManager-1.9.2/src/platform/nm-linux-platform.c:3969: check_return: Calling "_nl_send_nlmsg" without checking return value (as is done elsewhere 4 out of 5 times). 34. NetworkManager-1.9.2/src/nm-core-utils.c:2843: negative_returns: "fd2" is passed to a parameter that cannot be negative. 26. NetworkManager-1.9.2/src/devices/wwan/nm-modem-broadband.c:897: check_return: Calling "nm_utils_parse_inaddr_bin" without checking return value (as is done elsewhere 4 out of 5 times). 3. NetworkManager-1.9.2/src/devices/bluetooth/nm-bluez5-manager.c:386: check_return: Calling "g_variant_lookup" without checking return value (as is done elsewhere 79 out of 83 times). 16. NetworkManager-1.9.2/libnm-util/nm-setting.c:405: check_return: Calling "nm_g_object_set_property" without checking return value (as is done elsewhere 4 out of 5 times).
* platform/tests: relax checking for signals in test-link-linuxThomas Haller2017-10-301-1/+1
| | | | | | | | | | | | | | | | | | | | | # random seed: R02S4ca8cfc3dace399c0f15b42411e45d2e 1..48 # Start of link tests ok 1 /link/bogus PASS: src/platform/tests/test-link-linux 1 /link/bogus ok 2 /link/loopback PASS: src/platform/tests/test-link-linux 2 /link/loopback nmtst: initialize nmtst_get_rand() with NMTST_SEED_RAND=2697682474 ok 3 /link/internal PASS: src/platform/tests/test-link-linux 3 /link/internal ok 4 /link/external PASS: src/platform/tests/test-link-linux 4 /link/external # Start of software tests ./tools/run-nm-test.sh: line 193: 7589 Trace/breakpoint trap (core dumped) "${NMTST_DBUS_RUN_SESSION[@]}" "$TEST" "$@" NMPlatformSignalAssert: src/platform/tests/test-link.c:298, test_slave(): failure to accept signal 0 times: 'link-changed-changed' ifindex 9 (1 times received) ERROR: src/platform/tests/test-link-linux - too few tests run (expected 48, got 4) ERROR: src/platform/tests/test-link-linux - exited with status 133 (terminated by signal 5?)
* dhcp: add support for dhcpcanon clientjuga02017-10-305-3/+279
| | | | https://github.com/NetworkManager/NetworkManager/pull/31
* ifcfg-rh: set team and bond master for any connection typeBeniamino Galvani2017-10-271-17/+21
| | | | | | | | Now the plugin can only recognize team or bond slaves of type ethernet, vlan or infiniband. Instead, check the presence of a team or bond master for all types of connection to allow arbitrary stacking of interfaces.
* ifcfg-rh/trivial: move codeBeniamino Galvani2017-10-271-54/+54
|
* device: add proxy setting to generated connectionsBeniamino Galvani2017-10-271-0/+2
| | | | | | | | Add a proxy setting to generated connections because after commit 6f94b1650764 ("libnm: fix nm_connection_diff() for settings without properties") the matching between a connection having the setting and another connection without it fails. Before the commit, since no proxy property is marked as inferrable, such comparison succeeded.
* tests: increase timeout for arping testThomas Haller2017-10-271-1/+1
| | | | | | | I hit an assertion failure running with valgrind on a busy machine. Maybe the timeout is just not long enough for every case. Increase it.
* systemd: merge branch systemd into masterThomas Haller2017-10-272-13/+6
|\
| * systemd: update code from upstream (2017-10-27)Thomas Haller2017-10-272-13/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a direct dump from systemd git on 2017-10-27, git commit f630daaae90b48606f857c2d35a68f82e4471c8e. ====== SYSTEMD_DIR=../systemd COMMIT=f630daaae90b48606f857c2d35a68f82e4471c8e ( 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/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"
| * systemd: update code from upstream (2017-10-11)Thomas Haller2017-10-183-352/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a direct dump from systemd git on 2017-10-11, git commit 0da812036f6fd60a7b5477fafb2eead9e98f4c78. ====== SYSTEMD_DIR=../systemd COMMIT=0da812036f6fd60a7b5477fafb2eead9e98f4c78 ( 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/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"
* | ifcfg-rh: reread from disk when adding new connectionThomas Haller2017-10-272-11/+21
| |
* | ifcfg-rh: refactor nm_settings_plugin_add_connection() to return on error earlyThomas Haller2017-10-271-5/+9
| |
* | ifcfg-rh: don't check can_write_conection before writingThomas Haller2017-10-271-6/+3
| | | | | | | | | | nms_ifcfg_rh_writer_write_connection() also calls nms_ifcfg_rh_writer_can_write_connection() as first check. No need to duplicate the check.
* | ifcfg-rh: split function to write connection to diskThomas Haller2017-10-272-77/+182
| |
* | ifcfg-rh: write wired setting for bridge connectionsBeniamino Galvani2017-10-261-2/+4
| | | | | | | | | | Write the wired setting of bridge connections, otherwise properties such as ethernet.cloned-mac-address won't be saved.
* | libnm: fix nm_connection_diff() for settings without propertiesThomas Haller2017-10-261-2/+4
| | | | | | | | | | | | | | | | | | NMSettingGeneric has no properties at all. Hence, nm_connection_diff() would report that a connection A with a generic setting and a connection B without a generic setting are equal. They are not. For empty settings, let nm_setting_diff() return also empty difference hash.
* | ifcfg-rh/tests: test nm_connection_diff() not showing difference for empty ↵Thomas Haller2017-10-261-0/+164
| | | | | | | | generic setting
* | settings: keep connection alive in delete_auth_cb()Beniamino Galvani2017-10-261-0/+3
| | | | | | | | | | | | | | | | | | | | Before commit 3ecb57fdc468 ("settings: get rid of callback arguments for nm_settings_connection_delete()") audit logging was done in the callback, which was run by nm_settings_connection_delete() with a reference to the connection to keep it alive. Now we have to keep an extra reference to ensure it doesn't go away. Fixes: 3ecb57fdc46833f2377fa86e045cd0f8461eaab9
* | ifcfg-rh/trivial: add code comment about re-reading connection in writerThomas Haller2017-10-251-0/+7
| |
* | ifcfg-rh: don't allow policy routing mixed with an existing rule fileThomas Haller2017-10-252-4/+31
| | | | | | | | | | | | | | | | | | | | | | Eventually, we want to fully implement policy routing and handle rules as well. When that happens, we will use the route-table setting to tell NetworkManager to handle the rule file as well. Since we currently don't yet support that, we should reject configuring a non-zero routing table combined with a rule file, because later we will change behavior in that case.
* | ifcfg-rh: don't let complex routes (rule files) prevent writing connectionThomas Haller2017-10-254-48/+92
| | | | | | | | | | ... if the connection has no static routes, there is no reason to reject writing to these files, we don't touch the route file.
* | ifcfg-rh: don't limit reading static routes and addresses to 256Thomas Haller2017-10-251-2/+2
| | | | | | | | | | | | | | We should support an arbitrary number of routes and addresses. Arguably, our accessors for shvarFile are O(n), hence with large ifcfg files, we will have a performance problem. The fix for that would be to index the files.
* | settings: drop redundant can_commit() virtual functionsThomas Haller2017-10-253-28/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only implementation of can_commit() was ifcfg-rh, which bails out with complex routes. Note that the only caller of can_commit() (update_auth_cb()), immidiately afterwards called nm_settings_connection_commit_changes(), which, a few layers down in nms_ifcfg_rh_writer_write_connection() as first thing errors out in presence of complex routes. The check was redundant. In general, a can_commit() function before a commit_changes() makes no sense, because commit_changes() can just fail with error.
* | ifcfg-rh/tests: rename test function connection_from_file_test()Thomas Haller2017-10-253-14/+13
| | | | | | | | | | Test functions shall have a nmtst_ prefix. Then they don't need a code comment that they are for testing only.
* | ifcfg-rh: write blobs only do disk after determining what to writeThomas Haller2017-10-251-33/+51
| |
* | ifcfg-rh: write ip4 alias files after the main failThomas Haller2017-10-251-2/+6
| | | | | | | | | | | | | | | | write_ip4_aliases() does not collect internal in-memory state, instead it writes state to disk and deletes extraneous alias files. It should be done after we completed our pre-run checks to generated the data we want to write.
* | ifcfg-rh: rework writing secrets and write them all at once laterThomas Haller2017-10-251-49/+85
| | | | | | | | | | | | | | | | | | | | | | | | Instead of having set_secret() for each call open the file, mangle it, and write it back, collect all secrets and process them at the end once. Also, previously set_secrets() ignored failures to write a secret and added the secret in plain to the ifcfg file. Let's not do that. Also, purge all other entires form the secrets file. Not only the once that we explicitly touch.
* | ifcfg-rh: replace svUnsetValuesWithPrefix() by svUnsetAll(USER)Thomas Haller2017-10-253-25/+10
| |
* | ifcfg-rh: use svUnsetAll() to clear IPv4 address propertiesThomas Haller2017-10-253-7/+9
| |
* | ifcfg-rh: write route file outside of write_ipx_setting()Thomas Haller2017-10-251-56/+71
| | | | | | | | | | | | | | | | | | | | Eventually, we should generate all configuration in-memory first, and only after validating everything write to disk. That avoids that we start touching files, and later encounter a fatal error that let's us abort writing the connection. Also, previously, we would not purge the route file if write_ip6_setting() returns early for slave types.
* | ifcfg-rh: rework writing route file in sv formatThomas Haller2017-10-251-62/+58
| | | | | | | | | | | | | | | | | | | | | | | | - we now safe all routes we have, not limited to 256. - we use svUnsetAll() to delete the existing keys. This is faster then probing them one-by-one, and not limited to 256 keys (which we were checking before). Note that we always try to load an existing file and drop the unneeded keys. We do that, so that unrelated entries and comments don't get the deleted. Also, so that the order of the variables is not changed.
* | ifcfg-rh: add svUnsetAll() functionThomas Haller2017-10-252-0/+58
| |
* | ifcfg-rh: don't fail creating shvarFile instanceThomas Haller2017-10-251-2/+4
| | | | | | | | | | | | When calling svOpenFileInternal() with @create, we don't care about potential errors reading the file. We shouldn't return NULL in such case, but always create a shvarFile instance.
* | ifcfg-rh: merge IPv4 and IPv6 implementations of write_route_file()Thomas Haller2017-10-251-53/+9
| |
* | ifcfg-rh: fix handling error writing route file to diskThomas Haller2017-10-251-10/+6
| | | | | | | | | | Do not return failure based on whether an @error argument is given.