summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* n-dhcp4: keep trying after a failure in send()bg/nettools-max-attemptsBeniamino Galvani2020-02-241-12/+13
| | | | | | | | | | | | | | | | | Currently if an error is encountered during a send() of a message, the client fails and there is no possibility of recover, since no timers are armed after a failed event dispatch. An easy way to reproduce a failure is to add a firewall rule like: iptables -A OUTPUT -p udp --dport 67 -j REJECT which makes the send() fail with EPERM during the renew. In such case, the client should continue (failing) until it reaches the rebind phase at T2, when it will be able to renew the lease using the packet socket. In general, a failure to send a packet should not cause the failure of the client.
* n-dhcp4: fix logging macroBeniamino Galvani2020-02-241-2/+3
| | | | | The level can be a complex expression, don't use it directly in the macro.
* gitlab-ci: fix deploying documentation after switching to Fedora 31Thomas Haller2020-02-221-1/+1
| | | | Fixes: ec8068ec0c73 ('gitlab-ci: add "t_fedora:32" and by default build on Fedora 31')
* platform: avoid compiler warning in _NMP_OBJECT_TYPE_IS_OBJ_WITH_IFINDEX()Thomas Haller2020-02-221-2/+8
| | | | | | | | | | | | | Surisingly, the compiler may detect the remaining obj_type in the default switch. Then, inlining nmp_class_from_type() it may detect that this is only possible to hit with an out or range access to _nmp_classes array. Rework the code to avoid that compiler warning. It's either way not supposed to happen. Also, drop the default switch case and explicitly list the enum values. Otherwise it is error prone to forget a switch case.
* platform: belatedly add NMP_OBJECT_TYPE_LNK_VRF to ↵Thomas Haller2020-02-221-0/+1
| | | | | | _NMP_OBJECT_TYPE_IS_OBJ_WITH_IFINDEX() Fixes: 7c73c6a038a1 ('platform: add VRF support')
* release: bump version to 1.23.2-dev1.23.2-devThomas Haller2020-02-212-2/+2
|
* all: merge branch 'th/fix-gitlab-ci-failures'Thomas Haller2020-02-2116-32/+87
|\
| * libnm-core/tests: avoid -Wstring-compare in unit test for NM_IN_SET()Thomas Haller2020-02-211-2/+4
| | | | | | | | | | | | | | | | | | | | Clang 10 doesn't like NM_IN_SET() with strings and is right about that: ../libnm-core/tests/test-general.c:7763:9: error: result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Werror,-Wstring-compare] (void) NM_IN_SET ("a", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ However, NM_IN_STRSET() should work.
| * build: disable -Wimplicit-fallthrough warning with clangThomas Haller2020-02-212-2/+42
| | | | | | | | | | | | | | | | | | | | | | Seems clang 10 got support for -Wimplicit-fallthrough, but does not honor the code comments to suppress the warning. What a disaster. Try to detect it. See-also: https://github.com/ClangBuiltLinux/linux/issues/ #636 See-also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e2079e93f562c7f7a030eb7642017ee5eabaaa10
| * all: unify spelling of "fall-through" comment for switch statementsThomas Haller2020-02-2110-20/+20
| | | | | | | | | | We used "/* fall through */" and "/* fall-through */" inconsistently. Rename to use only one variant.
| * build/meson: fix missing dependency when building nm-libnm-auxThomas Haller2020-02-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [351/932] Compiling C object libnm/fdede0a@@nm-libnm-aux@sta/.._shared_nm-libnm-aux_nm-libnm-aux.c.o. FAILED: libnm/fdede0a@@nm-libnm-aux@sta/.._shared_nm-libnm-aux_nm-libnm-aux.c.o gcc -Ilibnm/fdede0a@@nm-libnm-aux@sta -Ilibnm -I../libnm -Ilibnm-core -I../libnm-core -I. -I../ -Ishared -I../shared -I/usr/include/gio-unix-2.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=gnu11 -O2 -g -Wall -Wextra -Wdeclaration-after-statement -Wfloat-equal -Wformat-nonliteral -Wformat-security -Wimplicit-fallthrough -Wimplicit-function-declaration -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wmissing-prototypes -Wpointer-arith -Wshadow -Wshift-negative-value -Wstrict-prototypes -Wundef -Wvla -Wno-duplicate-decl-specifier -Wno-format-truncation -Wno-format-y2k -Wno-missing-field-initializers -Wno-pragmas -Wno-sign-compare -Wno-unknown-pragmas -Wno-unused-parameter -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef -fno-strict-aliasing -fPIC -pthread -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40 -DG_LOG_DOMAIN=libnmc -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT -MD -MQ libnm/fdede0a@@nm-libnm-aux@sta/.._shared_nm-libnm-aux_nm-libnm-aux.c.o -MF libnm/fdede0a@@nm-libnm-aux@sta/.._shared_nm-libnm-aux_nm-libnm-aux.c.o.d -o libnm/fdede0a@@nm-libnm-aux@sta/.._shared_nm-libnm-aux_nm-libnm-aux.c.o -c ../shared/nm-libnm-aux/nm-libnm-aux.c In file included from ../libnm-core/nm-connection.h:14, from ../libnm/nm-types.h:12, from ../libnm/nm-object.h:14, from ../libnm/nm-access-point.h:14, from ../libnm/NetworkManager.h:11, from ../shared/nm-default.h:288, from ../shared/nm-libnm-aux/nm-libnm-aux.c:3: ../libnm-core/nm-core-types.h:13:10: fatal error: nm-core-enum-types.h: No such file or directory 13 | #include "nm-core-enum-types.h" | ^~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
| * gitlab-ci: add "t_fedora:32" and by default build on Fedora 31Thomas Haller2020-02-211-2/+8
| |
| * tests: ignore valgrind warnings for unhandled syscalls in ↵Thomas Haller2020-02-211-6/+12
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libnm,service-provider tests Otherwise, we get test failures with valgrind on fedora:rawhide (valgrind-3.15.0-18.fc33.x86_64.rpm, gcc-10.0.1-0.8.fc33.x86_64, glib2-devel-2.63.5-3.fc33.x86_64): >>>> PRINT VALGRIND LOGS (valgrind test) (start) + find -name '*.valgrind-log' -print0 + xargs -0 grep -H '^' ./src/devices/wwan/tests/test-service-providers.valgrind-log:--95634-- WARNING: unhandled amd64-linux syscall: 315 ./src/devices/wwan/tests/test-service-providers.valgrind-log:--95634-- You may be able to write your own handler. ./src/devices/wwan/tests/test-service-providers.valgrind-log:--95634-- Read the file README_MISSING_SYSCALL_OR_IOCTL. ./src/devices/wwan/tests/test-service-providers.valgrind-log:--95634-- Nevertheless we consider this a bug. Please report ./src/devices/wwan/tests/test-service-providers.valgrind-log:--95634-- it at http://valgrind.org/support/bug_reports.html. ./libnm/tests/test-remote-settings-client.valgrind-log:--95245-- WARNING: unhandled amd64-linux syscall: 315 ./libnm/tests/test-remote-settings-client.valgrind-log:--95245-- You may be able to write your own handler. ./libnm/tests/test-remote-settings-client.valgrind-log:--95245-- Read the file README_MISSING_SYSCALL_OR_IOCTL. ./libnm/tests/test-remote-settings-client.valgrind-log:--95245-- Nevertheless we consider this a bug. Please report ./libnm/tests/test-remote-settings-client.valgrind-log:--95245-- it at http://valgrind.org/support/bug_reports.html. ./libnm/tests/test-secret-agent.valgrind-log:--95280-- WARNING: unhandled amd64-linux syscall: 315 ./libnm/tests/test-secret-agent.valgrind-log:--95280-- You may be able to write your own handler. ./libnm/tests/test-secret-agent.valgrind-log:--95280-- Read the file README_MISSING_SYSCALL_OR_IOCTL. ./libnm/tests/test-secret-agent.valgrind-log:--95280-- Nevertheless we consider this a bug. Please report ./libnm/tests/test-secret-agent.valgrind-log:--95280-- it at http://valgrind.org/support/bug_reports.html. ./libnm/tests/test-nm-client.valgrind-log:--95208-- WARNING: unhandled amd64-linux syscall: 315 ./libnm/tests/test-nm-client.valgrind-log:--95208-- You may be able to write your own handler. ./libnm/tests/test-nm-client.valgrind-log:--95208-- Read the file README_MISSING_SYSCALL_OR_IOCTL. ./libnm/tests/test-nm-client.valgrind-log:--95208-- Nevertheless we consider this a bug. Please report ./libnm/tests/test-nm-client.valgrind-log:--95208-- it at http://valgrind.org/support/bug_reports.html. + echo '>>>> PRINT VALGRIND LOGS (valgrind test) (done)' >>>> PRINT VALGRIND LOGS (valgrind test) (done)
* license: minor spelling fixes in RELICENSE.mdThomas Haller2020-02-211-2/+2
|
* license: add Robert to RELICENSE.mdThomas Haller2020-02-211-0/+2
| | | | https://mail.gnome.org/archives/networkmanager-list/2020-February/msg00019.html
* shared: add more debug messages to nm_utils_parse_inaddr_bin_full()Beniamino Galvani2020-02-211-5/+31
| | | | | | Log the reason for the assertion failure to debug the crash in [1]. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1797915
* core: merge branch 'th/nm-dhcp-config-merge'Thomas Haller2020-02-2117-472/+368
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/423
| * device: merge nm_device_get_dhcp[46]_config() to nm_device_get_dhcp_config()Thomas Haller2020-02-215-17/+12
| |
| * core: add common base class NMDhcpConfig for NMDhcp[46]Config and merge themThomas Haller2020-02-2112-314/+209
| | | | | | | | | | | | | | | | | | | | The advantage is that the API is now the same for IPv4 and IPv6: it's all nm_dhcp_config_*() and we can (easier) treat the address family generically. We still need two distinct GObject types, mainly because of the glue code for exposing the object on D-Bus as NMDBusObject. Of course, that could be solved differently, but as it is, it's quite nice.
| * core: rename "nm-dhcp4-config.[ch]" to "nm-dhcp-config.[hc]" before mergeThomas Haller2020-02-218-8/+8
| | | | | | | | | | NMDhcp4Config and NMDhcp6Config will get a common base type NMDhcpConfig and be merged. In preparation, rename the file.
| * core: avoid duplicate lookup in nm_utils_strdict_to_variant()Thomas Haller2020-02-211-6/+6
| | | | | | | | | | Collect the full list of key and values, while sorting the key. This way, we don't need to lookup the values by key later.
| * shared: extend NM_GOBJECT_PROPERTIES_DEFINE*() macros to append suffix to ↵Thomas Haller2020-02-211-16/+22
|/ | | | | | | defined names This way, we will be able to use the macro multiple times in the same source file by using different suffixes.
* platform: merge branch 'th/platform-link-type-metadata'Thomas Haller2020-02-213-84/+240
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/421
| * platform: use nm_streq() instead of strcmp()Thomas Haller2020-02-211-4/+5
| |
| * platform: use binary search to lookup NMLinkType for devtypeThomas Haller2020-02-211-8/+70
| |
| * platform: use binary search to lookup NMLinkType for rtnl_typeThomas Haller2020-02-211-5/+77
| |
| * platform: index LinkDesc array by NMLinkTypeThomas Haller2020-02-211-63/+62
| | | | | | | | | | No need to iterate over the whole array, when we can just index it by the link type that we look for.
| * platform: don't assign meaning to NMLinkType numeric valuesThomas Haller2020-02-212-12/+34
|/ | | | | | | | | It would be better if we would be able to use NMLinkType enum as an index (e.g. into an array of LinkDesc structures). For that, it is necessary that the enum is just consecutive numbers. Don't assign special meaning to the enum. Also, this was only used at two places, that we can solve differently.
* libnm: disable "-Wtautological-constant-out-of-range-compare" warning with clangThomas Haller2020-02-212-0/+2
| | | | | | | | | | | | | | | | | | | | Seen on Debian 9, clang-3.8 (1:3.8.1-24): ../libnm-core/nm-setting-bond.c:596:49: error: comparison of constant 32 with expression of type 'NMBondMode' is always true [-Werror,-Wtautological-constant-out-of-range-compare] nm_assert (_NM_INT_NOT_NEGATIVE (mode) && mode < 32); ~~~~ ^ ~~ This warning is not useful. While it may be implementation defined how enum values outside the defined ones are handled, we commonly rely on placing special numeric values in enums (e.g. ((NMEnumType) -1)). An enum is (with our compilers) just a glorified integer, and there is nothing preventing it from being outside the enum values. The warning is not helpful and outright wrong. Disable it. See-also: https://bugs.llvm.org//show_bug.cgi?id=16154 Fixes: 957bb2e11160 ('libnm: use binary search for _nm_setting_bond_option_supported() implementation')
* build/autotools: fix passing AM_CFLAGS when building libnm-coreThomas Haller2020-02-211-1/+1
| | | | | | | | | | | | | | | | | With `./configure --enable-more-asserts`, we add extra -W flags to AM_CFLAGS. This variable is only used, if the per-library override libnm_core_libnm_core_la_CFLAGS is unspecified ([1]). Usually we avoid this problem be never specifying library_CFLAGS, but placing all our per-library flags to library_CPPFLAGS. While that is a bit of a hack and misuse of CPPFLAGS, it works well (enough). This was broken recently. The effect was, that libnm-core was not build with AM_CFLAGS flags. Fix it. [1] https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html Fixes: d2d6a6869755 ('build: use -fcommon when building libnm-core')
* contrib/scripts: add "checkpatch-git-post-commit-hook" script to contrib/Thomas Haller2020-02-211-0/+23
| | | | This can be used as git post-commit hook.
* nm-setting-bond: do not shadow stack variable with same nameAntonio Cardace2020-02-211-1/+0
| | | | | | GCC complains about this when compiling with -Wshadow Fixes: 8775c25c3318 ('libnm: verify bond option in defined order')
* po: update Ukrainian (uk) translationYuri Chornoivan2020-02-201-1104/+1172
| | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/420
* bond: merge branch 'th/bond-allow-arp-validate'Thomas Haller2020-02-197-194/+340
|\ | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1789437 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/418
| * libnm: verify bond option in defined orderThomas Haller2020-02-191-23/+38
| | | | | | | | | | | | | | | | verify() should validate options in a deterministic order, so that the same profile (with same libnm version) gives the same failure reason every time. Hence, visit the options in sorted order, like we do for nm_setting_bond_get_option().
| * libnm: sort "mode" in nm_setting_bond_get_option() firstThomas Haller2020-02-192-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Internally, the options are tracked in a hash table and of undefined sort order. However, nm_setting_bond_get_option() always returns a stable (sorted) order. Move "mode" as first, because that is usually the most interesting option. The effect is: $ nmcli -o connection show "$BOND_PROFILE" ... -bond.options: arp_interval=5,arp_ip_target=192.168.7.7,arp_validate=active,mode=balance-rr,use_carrier=0 +bond.options: mode=balance-rr,arp_interval=5,arp_ip_target=192.168.7.7,arp_validate=active,use_carrier=0 This doesn't affect keyfile, which sorts the hash keys themself (and doesn't treat the "mode" special). This however does affect ifcfg-rh writer how it writes the BONDING_OPTS variable. I think this change is fine and preferable.
| * libnm: cleanup string comparison in "nm-setting-bond.c"Thomas Haller2020-02-191-18/+20
| | | | | | | | | | | | | | | | strcmp() is hard to understand visually. Especially when different patterns are mixed, like: if ( !strcmp (name, NM_SETTING_BOND_OPTION_MIIMON) && strcmp (value, "0") != 0) {
| * libnm: use binary search for finding bond options to validateThomas Haller2020-02-192-102/+171
| |
| * libnm: use binary search for _nm_setting_bond_option_supported() implementationThomas Haller2020-02-191-20/+18
| |
| * shared: add nm_utils_named_values_from_str_dict_full() to allow different ↵Thomas Haller2020-02-192-3/+18
| | | | | | | | sort order (or none)
| * shared: add NM_UTILS_STRING_TABLE_LOOKUP_STRUCT_DEFINE() macro for lookup of ↵Thomas Haller2020-02-191-18/+41
| | | | | | | | structs
| * shared: add NM_MORE_ASSERT_ONCE() macroThomas Haller2020-02-191-0/+18
| |
| * device: allow setting "arp_validate" with supported bond modesThomas Haller2020-02-191-9/+2
|/ | | | | | | | | arp_validate is allowed for several bonding modes, at least since commit [1]. The validation was too strict. Just use set_bond_attr() directly, that already correctly encodes whether to set the value or not. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=13ac34a8866e31b31db6237c73aa558aff84d765
* Revert "core: create virtual device on settings changes in idle handler"Beniamino Galvani2020-02-191-49/+2
| | | | | | | | | | When AddConnection() or Update() terminate, the (unrealized) virtual device should be already be available, otherwise an activation attempt of that connection can fail. https://bugzilla.redhat.com/show_bug.cgi?id=1804350 This reverts commit c163207b077a0e66e344b2352ccbe392c76e63ed.
* shared/trivial: add code comment to nm_utils_ifname_valid_kernel()Thomas Haller2020-02-181-0/+4
|
* shared: check for valid UTF-8 in nm_utils_ifname_valid()Thomas Haller2020-02-181-1/+5
| | | | | | | | The interface name might come from the command line or from a filename (like during nm_vpn_wireguard_import()). It's not clear that this is valid UTF-8. Asserting against that requires the caller to ensure that the encoding is valid. That is cumbersome, especially since we anyway check. Just report a regular error.
* nm-shared-utils: relax ovs ifname check to accept any (non-space) ASCII ↵Antonio Cardace2020-02-182-17/+10
| | | | | | | | | | | | | | | | printable char quoting 'man ovs-vswitchd.conf.db': "The name must be alphanumeric and must not contain forward or backward slashes." OVS actually accepts a wider range of chars (all printable UTF-8 chars), NetworkManager restricts this to ASCII char as it's a safer option for now since OVS is not well documented on this matter. https://bugzilla.redhat.com/show_bug.cgi?id=1788432 Fixes: e7d72a14f6 ('libnm-core: use different ifname validation function for OVS bridges, ports and interfaces')
* device: fix handling of DHCP grace periodBeniamino Galvani2020-02-181-0/+2
| | | | | | 'grace_pending' was never initialized. Fixes: 0c52c18b5632 ('device: unify handling of grace-period for DHCPv4 and DHCPv6 (2)')
* ovs: merge branch 'bg/ovs-deactivate-async-pt2'Beniamino Galvani2020-02-173-27/+84
|\ | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1787989 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/412
| * ovs: discard link updates when deactivatingBeniamino Galvani2020-02-173-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | When the ovs interface gets deactivated, it is released from the master port and we call nm_device_update_from_platform_link (dev, NULL) to ignore any later event for the interface. This is important especially because it sets a zero ifindex on the interface and so, later when the link disappears, we don't unmanage the device but directly remove it. However, since ovs commands are queued, the link could appear during the deactivation and we need to ignore such events. Add a new device method can_update_from_platform_link() for such purpose.