Commit graph

23211 commits

Author SHA1 Message Date
Thomas Haller
a1f4bcd611
tests: suppress valgrind warning about unsupported syscall for "test-config"
(cherry picked from commit d507563a80)
(cherry picked from commit 4036bc48e4)
(cherry picked from commit 9ff160d155)
(cherry picked from commit 1b9da18693)
2020-08-17 20:09:42 +02:00
Thomas Haller
8f644537a4
shared: add nm_g_slice_free() helper
How odd that such a macro does not exist yet. It seems like
the majorities of calls to g_slice_free() could be replaced
by this.

(cherry picked from commit dcdbe98406)
2020-08-17 20:09:42 +02:00
Thomas Haller
9e32b33d05
libnm: add internal _nm_connection_get_setting() accessor
nm_connection_get_setting() returns a pointer of type NMSetting.
That is very inconvenient, because most callers will need the
the result pointer as a setting subtype (like NMSettingConnection).

That would be like g_object_new() returning a "GObject *" pointer,
which is technically correct but annoying.

In the past that problem was avoided by having countless accessors
like nm_connection_get_setting_ip4_config(), etc. But that just blows
up the API and also is not generic. Meaning: the type is not a function
argument but the function itself. That makes composing the code harder
as the setting type cannot be treated generically (as a function argument).

Anyway. Add an internal wrapper that returns a void pointer.

(cherry picked from commit c4788e611e)
2020-08-17 20:09:42 +02:00
Thomas Haller
c850015138
release: bump version to 1.18.9 (development) 2020-05-29 13:54:27 +02:00
Thomas Haller
5af9a6dbc0
release: bump version to 1.18.8 2020-05-29 13:51:12 +02:00
Thomas Haller
944b88b79d
NEWS: update 2020-05-29 13:39:16 +02:00
Thomas Haller
8699d27173
ifcfg-rh: merge branch 'th/ifcfg-rh-802-1x-pin'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/520

(cherry picked from commit 266d054808)
(cherry picked from commit 698acfef4b)
(cherry picked from commit 4d1b316f91)
(cherry picked from commit a4e7994ac4)
2020-05-29 13:28:05 +02:00
Thomas Haller
d286e3dc28
ifcfg-rh: support persisting 802-1x.pin and pin-flags property
(cherry picked from commit 655fd1ebd8)
(cherry picked from commit 799cee5068)
(cherry picked from commit 77e1132845)
(cherry picked from commit 73865ffb0b)
2020-05-29 13:27:42 +02:00
Thomas Haller
80fccd5a16
libnm,ifcfg-rh: fix documentation for IEEE_8021X_SYSTEM_CA_CERTS in man nm-settings-ifcfg-rh
Fixes: 2a4fb75d3b ('ifcfg: add support for "802-1x.system-ca-certs" setting')
(cherry picked from commit b4537f2c03)
(cherry picked from commit 5d8a0837b3)
(cherry picked from commit e11232de96)
(cherry picked from commit e00e764167)
2020-05-29 13:27:14 +02:00
Thomas Haller
68420568e4
libnm,ifcfg-rh: fix documentation for IEEE_8021X_PASSWORD_RAW_FLAGS in man nm-settings-ifcfg-rh
Fixes: a83ab252ee ('ifcfg-rh: add support for 802-1x.password-raw property')
(cherry picked from commit 9fde21504e)
(cherry picked from commit 36ddd266a5)
(cherry picked from commit 52bb253f6b)
(cherry picked from commit 3afbaeb597)
2020-05-29 13:27:14 +02:00
Thomas Haller
fa9d237be0
libnm,ifcfg-rh: merge branch 'th/ifcfg-rh-ca-path'
https://bugzilla.redhat.com/show_bug.cgi?id=1840210
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/448

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/518

(cherry picked from commit e0c220e7e9)
(cherry picked from commit 8affcc19b6)
(cherry picked from commit 6066e16367)
(cherry picked from commit e18f4a3ca5)
2020-05-27 11:39:52 +02:00
Thomas Haller
ba21cae6da
libnm: update documentation for 802-1x ca-cert, ca-path and system-ca-certs
(cherry picked from commit 4f21b14b90)
(cherry picked from commit 0d35d14faf)
(cherry picked from commit 1a989a98bf)
(cherry picked from commit 388f3e18a9)
2020-05-27 11:30:45 +02:00
Thomas Haller
70479d0501
ifcfg-rh: fix handling "802-1x.{phase2-,}ca-path" in ifcfg-rh settings plugin
https://bugzilla.redhat.com/show_bug.cgi?id=1840210
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/448
(cherry picked from commit b6b6639c7c)
(cherry picked from commit 67f1da27fe)
(cherry picked from commit 7a20dd4dbb)
(cherry picked from commit 97b12a3c34)
2020-05-27 11:30:35 +02:00
Thomas Haller
d04144afdb
build: log system-ca-path configure setting in build scripts
(cherry picked from commit f8dcb3fc47)
(cherry picked from commit f3f179728e)
(cherry picked from commit eb9767a6c8)
(cherry picked from commit 359f7f3544)
2020-05-27 11:29:48 +02:00
Beniamino Galvani
04f5707731 ip-tunnel: merge branch 'bg/ip-tunnel-cloned-mac-rh1832170'
https://bugzilla.redhat.com/show_bug.cgi?id=1832170
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/503
(cherry picked from commit 2d8c87e22e)
(cherry picked from commit f50ed7a25e)
(cherry picked from commit bef2f8a4dd)
(cherry picked from commit b4fedfc57c)
2020-05-15 10:26:23 +02:00
Beniamino Galvani
d4c2be5f28 ip-tunnel: set cloned-mac-address only for layer2 tunnel devices
For ip-tunnel modes that encapsulate layer2 packets (gretap and
ip6gretap) we allow the presence of an ethernet setting in the
connection and honor the cloned-mac-address specified in it.

For all other modes, the ethernet setting is removed during
normalization, but a value different from 'preserve' could be set via
global default.

The kernel doesn't allow setting a MAC for layer3 devices, don't do
it.

(cherry picked from commit 0494a84878)
(cherry picked from commit 78ed14166c)
(cherry picked from commit d69d92c658)
(cherry picked from commit 60b4bdafcf)
2020-05-15 10:25:49 +02:00
Beniamino Galvani
ae208023f2 libnm-core: add _nm_ip_tunnel_mode_is_layer2()
(cherry picked from commit 48c93b3bba)
(cherry picked from commit 5d2f2a6549)
(cherry picked from commit d0f275e7f5)
(cherry picked from commit db82b52dbd)
2020-05-15 10:24:48 +02:00
Thomas Haller
20fa4433f2
acd: fix char buffer argument to _acd_event_to_string_buf()
(cherry picked from commit 6e9967939b)
(cherry picked from commit 1e1ae9ba07)
(cherry picked from commit c0997fa4f3)
(cherry picked from commit 53cb8ce245)
2020-05-08 07:59:05 +02:00
Thomas Haller
4a636dda9f
acd: avoid alloca() inside an unbounded loop
(cherry picked from commit b447c80ad8)
(cherry picked from commit ecb9e0e3df)
(cherry picked from commit 198e233b91)
(cherry picked from commit 78618ccbaf)
2020-05-07 14:13:13 +02:00
Thomas Haller
d0932fa988
libnm: fix gtk-doc annotations for nm_setting_match_get_interface_names()
Otherwise the function is not usable via generated bindings.

Fixes: 9b9dce9486 ('all: add 'match' setting')
(cherry picked from commit 180cda7632)
(cherry picked from commit 805adec9ca)
(cherry picked from commit b5a66b88b3)
(cherry picked from commit 2630758cb4)
2020-05-06 15:12:38 +02:00
Thomas Haller
307bc73fc7
all: merge branch 'th/strtoll-workaround'
https://bugzilla.redhat.com/show_bug.cgi?id=1797915

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/456

(cherry picked from commit d342fa267d)
(cherry picked from commit 85811e67dd)
(cherry picked from commit 32e0bd7e72)
2020-05-02 17:07:17 +02:00
Thomas Haller
2792b6619b
all: use wrappers for g_ascii_strtoll(), g_ascii_strtoull(), g_ascii_strtod()
Sometimes these function may set errno to unexpected values like EAGAIN.
This causes confusion. Avoid that by using our own wrappers that retry
in that case. For example, in rhbz#1797915 we have failures like:

    errno = 0;
    v = g_ascii_strtoll ("10", 0, &end);
    if (errno != 0)
        g_assert_not_reached ();

as g_ascii_strtoll() would return 10, but also set errno to EAGAIN.

Work around that by using wrapper functions that retry. This certainly
should be fixed in glib (or glibc), but the issues are severe enough to
warrant a workaround.

Note that our workarounds are very defensive. We only retry 2 times, if
we get an unexpected errno value. This is in the hope to recover from
a spurious EAGAIN. It won't recover from other errors.

https://bugzilla.redhat.com/show_bug.cgi?id=1797915
(cherry picked from commit 7e49f4a199)
(cherry picked from commit eec2740d71)
(cherry picked from commit 500f0b96ae)
2020-05-02 17:05:15 +02:00
Thomas Haller
12ab561ee9
shared: add nm_g_ascii_strtoull() to workaround bug
(cherry picked from commit 3b58c5fef4)
(cherry picked from commit 95565bef77)
(cherry picked from commit d629db4a0e)
2020-05-02 17:04:46 +02:00
Thomas Haller
e2bfbd9c81
shared: add nm_g_ascii_strtod() to workaround bug
(cherry picked from commit 35a9f632a8)
(cherry picked from commit f8cae1ed18)
(cherry picked from commit 0de1c3a53a)
2020-05-02 17:04:45 +02:00
Thomas Haller
4633d6a8b5
shared: add nm_g_ascii_strtoll() to workaround bug
(cherry picked from commit f4446e34c6)
(cherry picked from commit 6836679878)
(cherry picked from commit 49c523cf1e)
2020-05-02 17:04:44 +02:00
Thomas Haller
2511c64ea4
device/bluetooth: avoid g_ascii_strtoull() to parse capabilities
Avoid g_ascii_strtoull() calling directly. It has subtle issues, which is why
we have a wrapper for it.

(cherry picked from commit 659ac9cc12)
(cherry picked from commit 62469c1401)
(cherry picked from commit 386ea3ff26)
2020-05-02 17:04:35 +02:00
Thomas Haller
5b552d2946
ifupdown: use _nm_utils_ascii_str_to_int64() for converting netmask to string
(cherry picked from commit 3930ef194e)
(cherry picked from commit 1a80179c60)
(cherry picked from commit 1a54909bb4)
2020-05-02 17:03:24 +02:00
Thomas Haller
d446c90985 vpn: clear host part of IPv6 routes received from VPN plugin
Kernel would reject adding a route with a destination host part not
all zero. NetworkManager generally coerces such routes and there
are assertions in place to ensure that.

We forgot to ensure that for certain IPv6 routes from VPN plugins.
This can cause an assertion failure and wrong behavior.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/425

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/482
(cherry picked from commit b437bb4a6e)
(cherry picked from commit c7586e6388)
(cherry picked from commit 55c361453b)
(cherry picked from commit 75933cd6ff)
2020-04-28 09:44:43 +02:00
Beniamino Galvani
9f4ac106a2 release: bump version to 1.18.7 (development) 2020-04-24 16:15:03 +02:00
Beniamino Galvani
62f3dc4118 release: bump version to 1.18.6 2020-04-24 16:15:01 +02:00
Beniamino Galvani
251fcff9c6 release: update NEWS 2020-04-24 16:14:59 +02:00
Beniamino Galvani
352f1f5311 man: mention the meaning of may-fail in the nm-online man page
Commit b2a0738765 ('man: improve manual page for nm-online') removed
the explanation of how may-fail can be used to wait for a specific
address family during boot. I found that part useful.

Note: this branch doesn't have commit 1e5206414a ('device: don't
delay startup complete for pending-actions "autoconf", "dhcp4" and
"dhcp6"') and so the text is different from branch nm-1-22 and later.

https://bugzilla.redhat.com/show_bug.cgi?id=1825666
(cherry picked from commit 25583de20b)
(cherry picked from commit 02a31e71af)
(cherry picked from commit 74c4494b3b)
(cherry picked from commit 0417a5b4d1)
2020-04-24 16:14:04 +02:00
Beniamino Galvani
0df1adc423 ovs: merge branch 'bg/ovs-no-bridge-rh1797696'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/422
https://bugzilla.redhat.com/show_bug.cgi?id=1797696
(cherry picked from commit 47f81864ba)
(cherry picked from commit 4045608ca8)
(cherry picked from commit 9055250cef)
2020-04-24 15:44:51 +02:00
Beniamino Galvani
24d71b5278 ovs: fail port enslavement when the bridge device is not found
Fail the enslavement of the ovs port if the bridge device is not
found, instead of generating assertions and potentially crash later.

https://bugzilla.redhat.com/show_bug.cgi?id=1797696

Fixes: 101e65d2bb ('ovs: allow changing mac address of bridges and interfaces')
(cherry picked from commit c5c49995b1)
(cherry picked from commit 7494a2e37a)
(cherry picked from commit bb7f729eca)
2020-04-24 15:44:43 +02:00
Beniamino Galvani
d1082e6323 ovs: fail port enslavement when the bridge AC is not found
The previous code tried to get the bridge active connection and it
used the port active connection instead in case of failure. This
doesn't seem right, as in nm-ovsdb.c the bridge AC is used to get the
bridge settings (including the uuid, interface name, and cloned mac).

In case of failure getting the bridge AC we should just fail.

Fixes: 830a5a14cb ('device: add support for OpenVSwitch devices')
(cherry picked from commit c8b5a3f91a)
(cherry picked from commit d8fb95d22b)
(cherry picked from commit 323a557f74)
2020-04-24 15:44:41 +02:00
Thomas Haller
4479c026b8 build/autotools: fix passing AM_CFLAGS when building libnm-core
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: d2d6a68697 ('build: use -fcommon when building libnm-core')
(cherry picked from commit 16df1c179d)
(cherry picked from commit 96f50cf9d8)
(cherry picked from commit 9430c693fe)
2020-04-24 15:42:35 +02:00
Thomas Haller
2186c9934f cli: unset "ipv[46].never-default" when setting "ipv[46].gateway"
Since commit c1907a218a ('libnm-core: remove gateway when
never-default=yes in NMSettingIPConfig'), the gateway gets normalized
away when the profile has never-default set.

That means,

  $ nmcli connection modify "$PROFILE" ipv4.never-default yes ipv4.gateway 192.168.77.1

does not set the gateway. Likewise, if your profile has already never-default
enabled,

  $ nmcli connection modify "$PROFILE" ipv4.gateway 192.168.77.1

will have no effect. That is confusing and undesirable.

Note that we don't adjust the GObject property setter for "gateway" to clear
never-default. I feel, setting one property in libnm should preferably
not unset another (there are exceptions to the rule, like for team
properties). However, for nmcli it's clear in which order properties
are set, so this change is right for the client tool.

https://bugzilla.redhat.com/show_bug.cgi?id=1785039

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/475
(cherry picked from commit 411255d51f)
(cherry picked from commit fae37528d9)
(cherry picked from commit d2606cc49e)
(cherry picked from commit 7ef4185714)
2020-04-22 21:40:22 +02:00
Beniamino Galvani
21a43510f4 dhcp-helper: retry in case of failure connecting to D-Bus unix socket
Connecting to the unix socket can fail with EAGAIN if there are too
many pending connections and the server can't accept them in time
before reaching backlog capacity. Ideally the server should increase
the backlog length, but GLib doesn't provide a way to change it for a
GDBus server. Retry for up to 5 seconds in case of failure.

https://bugzilla.redhat.com/show_bug.cgi?id=1821594
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/471
(cherry picked from commit eefe5dacaa)
(cherry picked from commit 4cf63dfa15)
(cherry picked from commit 2b7908a1c6)
(cherry picked from commit 87f24157ef)
2020-04-21 09:03:31 +02:00
Thomas Haller
a6e92c2342 contrib/rpm: fix bare words in spec file for %{ibft_enabled}
error: bare words are no longer supported, please use "...":  no != yes
  error:                                                        ^
  error: /builds/NetworkManager/NetworkManager/contrib/fedora/rpm/NetworkManager.20200420-192728.bRtN05/SPECS/NetworkManager.spec:614: bad %if condition:  no != yes
2020-04-20 21:46:23 +02:00
Thomas Haller
830b09cbe5 libnm-core/tests: avoid -Wstring-compare in unit test for NM_IN_SET()
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.

(cherry picked from commit c437d6c60a)
(cherry picked from commit c8f372b3a6)
(cherry picked from commit cf5a18812a)
2020-04-20 21:06:04 +02:00
Thomas Haller
630ea80de0 build: disable -Wimplicit-fallthrough warning with clang
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
(cherry picked from commit 86dfc4b099)
(cherry picked from commit 6e23a1b95d)
(cherry picked from commit 307168ce91)
2020-04-20 20:35:18 +02:00
Antonio Cardace
ddb1c5d3c7 meson: add additional debug CFLAGS to use the same ones autotools uses
(cherry picked from commit 6dc8167588)
(cherry picked from commit ef786159c4)
(cherry picked from commit 39f0a20ca5)
2020-04-20 20:35:18 +02:00
Thomas Haller
a1f9f1fde3 tests: ignore valrind false positives when running meson tests
On newer versions, the test binaries where renamed so that meson and
autotools build the same executables. Hence, the workaround for
valgrind warnings works on newer versions, but not on this branch.

Instead of backporting the renaming of the build artefacts, adjust
the test runner to work with meson builds.
2020-04-20 20:18:33 +02:00
Thomas Haller
994dc555d5 platform: avoid compiler warning in _NMP_OBJECT_TYPE_IS_OBJ_WITH_IFINDEX()
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.

(cherry picked from commit 9848589fbf)
(cherry picked from commit 6f189da7b6)
(cherry picked from commit 6da20c24cd)
2020-04-20 19:52:50 +02:00
Thomas Haller
737d0f3b53 tests: ignore valgrind warnings for unhandled syscalls in 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)

(cherry picked from commit 3e616c306d)
(cherry picked from commit a9372112b9)
(cherry picked from commit 4fb9f98bc6)
2020-04-20 19:52:50 +02:00
Thomas Haller
5e4e328aaa clients/tests: don't include the source line number with client tests output
The client tests compare the test output with a .expected file that is
commit to git and that contains the expected output.

The expected output contains data like

    size: 395
    location: clients/tests/test-client.py:842:test_001()/1
    cmd: $NMCLI
    lang: C
    returncode: 0
    stdout: 277 bytes
    >>>
    ...

Note that there is the line number (clients/tests/test-client.py:842) of
the source code where nmcli is called. This is to help correlate the output
with the test code.

However, Python 3.8 changes behavior and for function calls that span multiple
lines, frame.f_lineno will give now the starting line (previously, it gave the last
line) (see [1]).

No longer include the line number, as it is not stable accross Python versions.

If you really care, you can set NM_TEST_WITH_LINENO to get the line numbers back.
Of course, then the expected output won't match anymore, and you'd have to regenerate
it first. This is only useful if you debug tests, and want to have it easier to
correlate output with the tests while developing them.

[1] https://bugs.python.org/issue38283

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/292
(cherry picked from commit ad3ef326aa)
(cherry picked from commit 275a7c46a1)
2020-04-20 17:48:05 +02:00
Thomas Haller
6f35066417 clients/tests: skip client tests with python 3.8-beta
It's unclear how to workaround this issue, so that the tests
work with older python versions and 3.8-beta.

Let's wait whether this will really be released as 3.8 and
for now just skip the test.

(cherry picked from commit d7b9906666)
(cherry picked from commit 460ed8112f)
2020-04-20 17:27:51 +02:00
Beniamino Galvani
d3ec31f839 clients: add missing 'extern' keyword
(cherry picked from commit 482e5f04ea)
(cherry picked from commit 1bb93b7289)
(cherry picked from commit 57e5e2d5a9)
2020-04-20 14:01:06 +02:00
Thomas Haller
eb3f64cbd7 platform: fix GCC warning about zero-length array in nmp_utils_ethtool_get_permanent_address()
GCC 10 complains about accesses to elements of zero-length arrays that
overlap other members of the same object:

  src/platform/nm-platform-utils.c: In function ‘nmp_utils_ethtool_get_permanent_address’:
  src/platform/nm-platform-utils.c:854:29: error: array subscript 0 is outside the bounds of an interior zero-length array ‘__u8[0]’ {aka ‘unsigned char[0]’} [-Werror=zero-length-bounds]
    854 |  if (NM_IN_SET (edata.e.data[0], 0, 0xFF)) {
  ./shared/nm-glib-aux/nm-macros-internal.h:731:20: note: in definition of macro ‘_NM_IN_SET_EVAL_N’

Fix this warning.

(cherry picked from commit d892a35395)
(cherry picked from commit c1417087c8)
(cherry picked from commit f7b9d06306)
2020-04-20 13:49:27 +02:00
Thomas Haller
2ebb933596 platform: fix GCC warning about zero-length array in ethtool_get_stringset()
GCC 10 complains about accesses to elements of zero-length arrays that
overlap other members of the same object:

 src/platform/nm-platform-utils.c: In function ‘ethtool_get_stringset’:
 src/platform/nm-platform-utils.c:355:27: error: array subscript 0 is outside the bounds of an interior zero-length array ‘__u32[0]’ {aka ‘unsigned int[0]’} [-Werror=zero-length-bounds]
   355 |  len = sset_info.info.data[0];
       |        ~~~~~~~~~~~~~~~~~~~^~~
 In file included from src/platform/nm-platform-utils.c:12:
 /usr/include/linux/ethtool.h:647:8: note: while referencing ‘data’
   647 |  __u32 data[0];
       |        ^~~~

Fix this warning.

(cherry picked from commit 16e1e44c5e)
(cherry picked from commit 286bb2f029)
(cherry picked from commit b474ed0044)
2020-04-20 13:49:27 +02:00