Commit graph

23159 commits

Author SHA1 Message Date
Thomas Haller
55645ecff4 connectivity: fix using curl_multi_strerror() for CURLMcode error code
(cherry picked from commit c24f122e22)
(cherry picked from commit 6f39520ee9)
2020-04-20 13:37:07 +02:00
Beniamino Galvani
28954f2e4b build: use -fcommon when building libnm-core
Building with GCC 10 gives the following error:

 multiple definition of_nm_jansson_json_object_iter_key';
 libnm/.libs/liblibnm.a(libnm_core_la-nm-json.o):/builddir/build/BUILD/NetworkManager-1.23.1/libnm-core/nm-json.c:24: first defined here /usr/bin/ld:
 libnm/.libs/liblibnm.a(libnm_core_la-nm-team-utils.o):/usr/include/jansson.h:202: multiple definition of _nm_jansson_json_object_iter';

This happens because GCC 10 defaults to -fno-common and so multiple
definitions of the same global variable are not merged together.

_nm_jansson_json_* symbols are defined in nm-json.c as void pointers
and, due to the following macros in nm-json.h:

 #define json_object_iter_next   (*_nm_jansson_json_object_iter_next)
 ...

the function declaration in jansson.h:

 void *json_object_iter_next(json_t *object, void *iter);

becomes a global variable as well:

 void *(*_nm_jansson_json_object_iter_next)(json_t *object, void *iter);

So, the symbol is present in nm-json.o and all other object files that
include nm-json.h, and -fcommon is required. Without it, it would be
necessary to define the symbols only in one place (for example,
nm-json.c), but then static inline functions from the jannson.h header
would still refer to the original (missing) jansson functions.

For the moment, just use -fcommon.

(cherry picked from commit d2d6a68697)
(cherry picked from commit 311872ddca)
(cherry picked from commit 5d797b91e4)
2020-04-20 13:29:55 +02:00
Thomas Haller
5e024468fa gitlab-ci: use old meson version on Ubuntu 16.04 to work with ninja-1.5.1
Meson 0.54.0 requires ninja-1.7 ([1]).

On Ubuntu 16.04, we now would get meson 0.54.0 via pip3, but ninja-1.5.1 via
apt. That doesn't work anymore.

We could install ninja via pip3, but of course, doing that on other
Debian/Ubuntu versions fails due to ... I don't even want to know.

So, instead use an old meson version on Ubuntu 16.04, which is
known to still work with the ninja provided by the packaging system.

We anyway don't want to test the same meson/ninja versions on all our
Ubuntu/Debian images. The point of having different images is to build
with different software versions. If `pip3 install` gives us the same
everywhere, it isn't very useful.

https://mesonbuild.com/Release-notes-for-0-54-0.html#ninja-version-requirement-bumped-to-17
(cherry picked from commit 5feba97cd1)
(cherry picked from commit b9b00a1cb3)
(cherry picked from commit 3199349196)
2020-04-20 12:29:27 +02:00
Thomas Haller
c4155b6dc3 gitlab-ci: set DEBIAN_FRONTEND=noninteractive for apt-get install
Otherwise, installing a package might prompt for the user to type something,
breaking the CI build.

(cherry picked from commit 571786c211)
(cherry picked from commit b033ab8449)
(cherry picked from commit e79ce721d3)
2020-04-20 12:29:21 +02:00
Thomas Haller
133e7ce703 gitlab-ci: fix deploying documentation after switching to Fedora 31
Fixes: ec8068ec0c ('gitlab-ci: add "t_fedora:32" and by default build on Fedora 31')
(cherry picked from commit f12b830a94)
(cherry picked from commit 5abb14611b)
(cherry picked from commit c553c2ff3f)
2020-04-20 12:29:16 +02:00
Thomas Haller
d71b56ebe7 gitlab-ci: add "t_fedora:32" and by default build on Fedora 31
(cherry picked from commit ec8068ec0c)
(cherry picked from commit f1a4961def)
(cherry picked from commit df61b7b170)
2020-04-20 12:29:11 +02:00
Thomas Haller
ce861e5292 gitlab-ci: fix generating "pages" after switching to Fedora 30 for main build
(cherry picked from commit c15682558c)
(cherry picked from commit 4ea999ac94)
(cherry picked from commit 4587b96cb2)
2020-04-20 12:29:05 +02:00
Thomas Haller
2ba65800f9 gitlab-ci: run tests on extra distributions only manually
For the moment, we use docker images from dockerhub, which require
a lot of extra overhead to prepare and install the test environment.
This should be improved, by using more suitable container images.

Anyway, for now to alleviate the pressure on the freedesktop gitlab
infrastructure, disable most test to only run manually.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/241#note_282521
(cherry picked from commit b733d477e8)
(cherry picked from commit 962297f908)
2020-04-20 12:28:50 +02:00
Thomas Haller
002e10d6b9 gitlab-ci: use Fedora 30 to build documentation and archived tarball
(cherry picked from commit 339df56887)
(cherry picked from commit 725141c07a)
2020-04-20 12:28:41 +02:00
Thomas Haller
362d528f5e checkpatch: catch "gs_free GError *" declations
(cherry picked from commit ec0adbfaf0)
(cherry picked from commit 2fa4827eb9)
(cherry picked from commit 00cf235a7a)
2020-04-20 12:12:45 +02:00
Lubomir Rintel
c694a8c935 contrib/checkpatch: fix the systemd code path
(cherry picked from commit ae6668ae85)
(cherry picked from commit 24d40570a7)
2020-04-20 12:12:39 +02:00
Lubomir Rintel
570030a687 contrib/checkpatch: allow empty lines within continuations
This chunk from nm-device.c is, in fact, okay:

               |<-tab->nm_assert (   !new_config
               |<-tab->           || (   new_config
               |<-tab->               && ({
               |<-tab->                    int ip_ifindex = ...
 empty line -> |
               |<-tab->                    (   ip_ifindex > 0
               |<-tab->                     && ip_ifindex == ...
               |<-tab->                  })));

(cherry picked from commit a5dd31afeb)
2020-04-20 12:11:36 +02:00
Lubomir Rintel
8e11e4b98c contrib/checkpatch: be a bit stricter about whitespace
In continations (that use spaces for alignment), don't allow the number
of leading tabs to change. Previously only removal of tabs was
disallowed, but addition doesn't make sense either, as only spaces
should be used for further alignemnt.

This catches situations like this:

  |<-tab->all_work_and_no_play (makes,
  |<-tab->                      jack,
  |<-tab-><-tab->               a dull boy);

(cherry picked from commit da312e6220)
2020-04-20 12:11:20 +02:00
Lubomir Rintel
744c821bbd contrib/checkpatch: discourage g_assert*()
(cherry picked from commit 5ff19ea8d2)
2020-04-20 12:10:43 +02:00
Lubomir Rintel
5dd1c6db65 contrib/checkpatch: properly determine the commit id boundary
It doesn't have to be at the end of line, there may be more words
following.

Fixes: d66a1ace23 ('contrib/checkpatch: avoid command injection in checkpatch.pl script')
(cherry picked from commit f3f8e21bd3)
2020-04-20 12:10:28 +02:00
Thomas Haller
ae23ef8b3c contrib/REQUIRED_PACKAGES: ignore for non-existing packages "dbus-python", "pygobject3-base" on Fedora 32
These packages no longer exist on Fedora 32 and dnf fails due to
that. Ignore such errors.

(cherry picked from commit bdd45e6afa)
(cherry picked from commit 27664ff425)
(cherry picked from commit e573f77855)
2020-04-20 12:04:21 +02:00
Thomas Haller
29e068cfe5 contrib/REQUIRED_PACKAGES: fix script to work without GNU which installed
`which` is convenient, but not installed in Fedora container images.
Fix detection of whether to use `dnf` or `yum`.

(cherry picked from commit 5cc8ca4038)
(cherry picked from commit 68fa338e34)
(cherry picked from commit ceb602cab1)
2020-04-20 12:03:34 +02:00
Thomas Haller
8a15ffabc3 contrib/rpm: drop BuildRequires to deprecated "wireless-tools-devel"
"wireless-tools-devel" is long depreacted and not used by
NetworkManager, not even for WEXT.

Drop it from the build dependencies.

(cherry picked from commit 9fc4490513)
(cherry picked from commit 35a2a71801)
2020-04-20 12:03:15 +02:00
Thomas Haller
e35d72a956 tools: export more symbols from NetworkManager binary to plugins
Plugins also may use nmtst_*() functions (when built with --with-more-asserts)
or c_list_*(). Whitelist them too.

(cherry picked from commit 7b6f1c2d90)
2020-04-20 11:56:41 +02:00
Thomas Haller
96dec0e21e tests: abort test runner if exec fails
(cherry picked from commit 2ad8e6acae)
(cherry picked from commit 24ab6b6cdc)
(cherry picked from commit b10d90a549)
(cherry picked from commit 3ca48236e4)
2020-04-20 11:55:48 +02:00
Thomas Haller
e15cc4d0fc run-nm-test: fix using exec instead of running and exiting
Otherwise, the script tries to run

  dbus-run-session -- exec ...

which fails (because `exec` is a shell command, not a program).
After the failure, the code falls through to run the test under
valgrind.

Fixes: 6a58c55ca4 ('run-nm-test: Just use exec instead of running and exiting')
(cherry picked from commit b9c4d2bb72)
(cherry picked from commit af4671cda0)
2020-04-20 11:55:42 +02:00
Marco Trevisan (Treviño)
884cd13f95 run-nm-test: Just use exec instead of running and exiting
(cherry picked from commit 6a58c55ca4)
(cherry picked from commit 44bb65485f)
2020-04-20 11:55:23 +02:00
Marco Trevisan (Treviño)
43ff43e8b1 run-nm-test: Set NM_TEST_UNDER_VALGRIND accordingly
When a test is going to be run under valgrind we set NM_TEST_UNDER_VALGRIND
so that we can properly check whether this is happening.

(cherry picked from commit 073eda68fc)
(cherry picked from commit 963ff8c2ab)
2020-04-20 11:55:23 +02:00
Thomas Haller
627dc8a933 contrib/rpm: use proper check for nmtui conditional build
(cherry picked from commit 0f4819ab36)
(cherry picked from commit cca752af94)
2020-04-20 11:45:42 +02:00
Thomas Haller
2d3df2e6ef contrib/rpm: fix parsing of %real_version_major for ".0" versions
(cherry picked from commit 6c9880f8ca)
(cherry picked from commit d734a4766c)
2020-04-20 11:45:22 +02:00
Thomas Haller
74ef5f7f05 contrib/rpm: fix spec file using bare words
error: bare words are no longer supported, please use "...":  no != "yes"
  error:                                                        ^
  error: /builds/NetworkManager/NetworkManager/contrib/fedora/rpm/NetworkManager.20200418-170120.dp5cp5/SPECS/NetworkManager.spec:596: bad %if condition:  no != "yes"

(cherry picked from commit ed94ab6e23)
(cherry picked from commit 1667be7cf5)
(cherry picked from commit 719d492f4a)
(cherry picked from commit 71d4e261f6)
2020-04-20 11:44:48 +02:00
Thomas Haller
49d314cb76 contrib/rpm: fix spec file using bare words
error: bare words are no longer supported, please use "...":  no != yes
  error: /builds/NetworkManager/NetworkManager/contrib/fedora/rpm/NetworkManager.20200418-163008.VM582H/SPECS/NetworkManager.spec:596: bad %if condition:  no != yes

(cherry picked from commit be78a12012)
(cherry picked from commit c869d792a2)
(cherry picked from commit 5735e267cd)
(cherry picked from commit 3fcc337770)
2020-04-20 11:44:47 +02:00
Thomas Haller
d7cf55849c contrib/rpm: avoid warning in specfile about tokens after %endif
warning: extra tokens at the end of %endif directive in line 717:  %endif # end autotools
warning: extra tokens at the end of %endif directive in line 775:  %endif # end autotools
(cherry picked from commit 0521e06ff1)
(cherry picked from commit 43aa1f7ff1)
2020-04-20 11:43:57 +02:00
Thomas Haller
a4f735029a shared/glib: reimplement g_atomic_pointer_compare_and_exchange() macro
With glib 2.63.2 and clang 9.0.0 (Fedora 32) we get compile errors:

  ../clients/cloud-setup/nmcs-provider-ec2.c:51:8: error: incompatible pointer types passing 'typeof ((((void *)0))) *' (aka 'void **') to parameter of type 'const char **' [-Werror,-Wincompatible-pointer-types]
                  if (!g_atomic_pointer_compare_and_exchange (&base_cached, NULL, base))
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/glib-2.0/glib/gatomic.h:192:44: note: expanded from macro 'g_atomic_pointer_compare_and_exchange'
      __atomic_compare_exchange_n ((atomic), &gapcae_oldval, (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \
                                             ^~~~~~~~~~~~~~
  ../src/devices/bluetooth/nm-bluez-manager.c:2836:2: error: incompatible pointer types passing 'typeof ((((void *)0))) *' (aka 'void **') to parameter of type 'const NMBtVTableNetworkServer **' (aka 'const struct _NMBtVTableNetworkServer **') [-Werror,-Wincompatible-pointer-types]
          g_atomic_pointer_compare_and_exchange (&nm_bt_vtable_network_server, NULL, &priv->vtable_network_server);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/glib-2.0/glib/gatomic.h:192:44: note: expanded from macro 'g_atomic_pointer_compare_and_exchange'
      __atomic_compare_exchange_n ((atomic), &gapcae_oldval, (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \
                                             ^~~~~~~~~~~~~~
  ../src/devices/bluetooth/nm-bluez-manager.c:2853:2: error: passing 'typeof ((&priv->vtable_network_server)) *' (aka 'struct _NMBtVTableNetworkServer **') to parameter of type 'const NMBtVTableNetworkServer **' (aka 'const struct _NMBtVTableNetworkServer **') discards qualifiers in nested pointer types [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
          g_atomic_pointer_compare_and_exchange (&nm_bt_vtable_network_server, &priv->vtable_network_server, NULL);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/glib-2.0/glib/gatomic.h:192:44: note: expanded from macro 'g_atomic_pointer_compare_and_exchange'
      __atomic_compare_exchange_n ((atomic), &gapcae_oldval, (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \
                                             ^~~~~~~~~~~~~~
  ../src/devices/nm-device.c:8857:8: error: incompatible pointer types passing 'typeof ((((void *)0))) *' (aka 'void **') to parameter of type 'GBytes **' (aka 'struct _GBytes **') [-Werror,-Wincompatible-pointer-types]
                  if (!g_atomic_pointer_compare_and_exchange (&global_duid, NULL, p)) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/glib-2.0/glib/gatomic.h:192:44: note: expanded from macro 'g_atomic_pointer_compare_and_exchange'
      __atomic_compare_exchange_n ((atomic), &gapcae_oldval, (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) ? TRUE : FALSE; \
                                             ^~~~~~~~~~~~~~

The issue happens because glib passes the "atomic" argument to

  __atomic_compare_exchange_n ((atomic), &gapcae_oldval, (newval), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)

without cast, and clang 9 seems to be picky about const pointers.
Add our own version of the macro that does better casts while also having
better compile time checks for valid arguments.

(cherry picked from commit f5b0713651)
(cherry picked from commit d8cc6af058)
(cherry picked from commit 925a688400)
2020-04-20 11:38:47 +02:00
Thomas Haller
c64217546f shared/glib: unconditionally redefine g_object_ref()/g_object_ref_sink() as typesafe macro
(cherry picked from commit 03b8eb124e)
2020-04-20 11:38:27 +02:00
Thomas Haller
072ef0c1e4 keyfile: minor cleanup handling error in read_array_of_uint()
Why "if (length > G_MAXUINT)"? This is never going to hit. Also,
we probably should actual missing keys handle differently from
empty lists. If @error is set, return without setting the property.

(cherry picked from commit 2cf31bfef0)
(cherry picked from commit f00d306ae7)
(cherry picked from commit cd33ea1fc0)
(cherry picked from commit e1acac6311)
2020-04-16 09:53:48 +02:00
Thomas Haller
815f48152f keyfile: avoid assertion failure in nm_keyfile_plugin_kf_get_{string,integer}_list()
g_key_file_get_integer_list() can return %NULL without setting an error.
That is the case if the key is set to an empty value.

For X sake, this API. Read the documentation and figure out whether
the function can return %NULL without reporting an error.

Anyway, avoid the assertion failure.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/412
(cherry picked from commit 8f46425b11)
(cherry picked from commit 97139f5e3d)
(cherry picked from commit 59d488cb46)
(cherry picked from commit b82a8e4e01)
2020-04-16 09:53:47 +02:00
Beniamino Galvani
1c187b7f54 manager: forbid autoactivation of parent when it is blocked by user request
If a device is being autoactivated and requires a parent that is
blocked due to user request, the autoactivation attempt should fail
because NM shouldn't overrule the user decision.

https://bugzilla.redhat.com/show_bug.cgi?id=1765566
(cherry picked from commit f2dbf8fbc0)
(cherry picked from commit 61d431a9e8)
(cherry picked from commit 74649429df)
2020-04-07 17:28:38 +02:00
Thomas Haller
bd7c768b79 initrd: fix setting VLan ID in reader_parse_vlan()
g_ascii_strtoull() returns a guint64, which is very wrong to directly pass
to the variadic argument list of g_object_set(). We expect a guint there
and need to cast.

While at it, use _nm_utils_ascii_str_to_int64() to parse and validate the input.

(cherry picked from commit d506823d4f)
(cherry picked from commit 24177569c1)
(cherry picked from commit 0a10468d79)
2020-04-02 09:52:50 +02:00
Thomas Haller
6e8582a08f contrib/rpm: avoid bare words in spec file
error: bare words are no longer supported, please use "...":  "x" != x
   error:                                                               ^
   error: /root/nm-build/NetworkManager/contrib/fedora/rpm/NetworkManager.20200402-030113.Hk7EGs/SPECS/NetworkManager.spec:32: bad %if condition:  "x" != x
   ERROR: rpmbuild FAILED

(cherry picked from commit 68b38a09d1)
(cherry picked from commit 045194760e)
(cherry picked from commit 477c6c3e70)
2020-04-02 09:37:57 +02:00
Thomas Haller
e905eb870f core: avoid assertion failure in _settings_connection_flags_changed() without device
It seems not unexpected, that we get a flags-changed notification while
having no device. Handle it gracefully and avoid the assertion failure.

   #0  _g_log_abort (breakpoint=breakpoint@entry=1) at gmessages.c:583
   #1  g_logv (log_domain=0x55f3c86f0262 "NetworkManager", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7ffcbf88f1c0) at gmessages.c:1391
   #2  g_log (log_domain=log_domain@entry=0x55f3c86f0262 "NetworkManager", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7f21e99adb27 "%s: assertion '%s' failed") at gmessages.c:1432
   #3  g_return_if_fail_warning (log_domain=log_domain@entry=0x55f3c86f0262 "NetworkManager", pretty_function=pretty_function@entry=0x55f3c875f290 <__func__.53083> "nm_device_reapply", expression=expression@entry=0x55f3c8752507 "NM_IS_DEVICE (self)") at gmessages.c:2809
   #4  nm_device_reapply (self=0x0, connection=connection@entry=0x55f3caab4e60, error=error@entry=0x7ffcbf88f308) at src/devices/nm-device.c:12107
   #5  _settings_connection_flags_changed (settings_connection=<optimized out>, self=0x55f3caabca70 [NMActRequest]) at src/nm-active-connection.c:960
   #9  <emit signal ??? on instance 0x55f3caaaf530 [NMSettingsConnection]> (instance=instance@entry=0x55f3caaaf530, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3447
   #6  g_closure_invoke (closure=0x55f3caa4c160, return_value=return_value@entry=0x0, n_param_values=1, param_values=param_values@entry=0x7ffcbf88f520, invocation_hint=invocation_hint@entry=0x7ffcbf88f4c0) at gclosure.c:804
   #7  signal_emit_unlocked_R (node=node@entry=0x55f3ca9dcf90, detail=detail@entry=0, instance=instance@entry=0x55f3caaaf530, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffcbf88f520) at gsignal.c:3635
   #8  g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffcbf88f6a0) at gsignal.c:3391
   #10 nm_settings_connection_set_flags_full (self=self@entry=0x55f3caaaf530 [NMSettingsConnection], mask=<optimized out>, value=<optimized out>) at src/settings/nm-settings-connection.c:2025
   #11 _connection_changed_process_all_dirty (update_reason=(NM_SETTINGS_CONNECTION_UPDATE_REASON_RESET_SYSTEM_SECRETS | NM_SETTINGS_CONNECTION_UPDATE_REASON_RESET_AGENT_SECRETS), sett_mask=<optimized out>, sett_flags=<optimized out>, connection=0x55f3caab4f80, sett_conn_entry=<optimized out>, self=0x55f3ca99c000 [NMSettings]) at src/settings/nm-settings.c:1099
   #12 _connection_changed_process_all_dirty (update_reason=(NM_SETTINGS_CONNECTION_UPDATE_REASON_RESET_SYSTEM_SECRETS | NM_SETTINGS_CONNECTION_UPDATE_REASON_RESET_AGENT_SECRETS), override_sett_flags=1, sett_mask=_NM_SETTINGS_CONNECTION_INT_FLAGS_PERSISTENT_MASK, sett_flags=<optimized out>, allow_add_to_no_auto_default=0, sett_conn_entry=<optimized out>, self=0x55f3ca99c000 [NMSettings]) at src/settings/nm-settings.c:1284
   #13 _connection_changed_process_all_dirty (self=self@entry=0x55f3ca99c000 [NMSettings], allow_add_to_no_auto_default=allow_add_to_no_auto_default@entry=0, sett_flags=sett_flags@entry=NM_SETTINGS_CONNECTION_INT_FLAGS_NONE, sett_mask=sett_mask@entry=NM_SETTINGS_CONNECTION_INT_FLAGS_NONE, override_sett_flags=override_sett_flags@entry=1, update_reason=update_reason@entry=(NM_SETTINGS_CONNECTION_UPDATE_REASON_RESET_SYSTEM_SECRETS | NM_SETTINGS_CONNECTION_UPDATE_REASON_RESET_AGENT_SECRETS)) at src/settings/nm-settings.c:1304
   #14 _plugin_connections_reload (self=self@entry=0x55f3ca99c000 [NMSettings]) at src/settings/nm-settings.c:1417
   #15 impl_settings_reload_connections (obj=0x55f3ca99c000 [NMSettings], interface_info=<optimized out>, method_info=<optimized out>, connection=<optimized out>, sender=<optimized out>, invocation=0x7f21d000c100 [GDBusMethodInvocation], parameters=0x55f3ca9e1f20) at src/settings/nm-settings.c:2822
   ...

https://bugzilla.redhat.com/show_bug.cgi?id=1816067
(cherry picked from commit 44fed3c340)
(cherry picked from commit cdfb762880)
(cherry picked from commit 56c653eca5)
2020-03-23 13:35:45 +01:00
Thomas Haller
8af2570b15 man: improve manual page for nm-online
Patch backported from nm-1-20 to nm-1-18, but modified to not mention
"connection.wait-device-timeout", which doesn't exist on nm-1-18.

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

(cherry picked from commit b2a0738765)
(cherry picked from commit 4b07cb9d3c)
(cherry picked from commit 76fedd150b)
2020-03-17 13:41:54 +01:00
Beniamino Galvani
eefc12866b device: merge branch 'bg/parent-mtu-rh1723690-part1'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/273
(cherry picked from commit facfc94744)
(cherry picked from commit 188911ae7d)
2020-03-16 11:55:27 +01:00
Beniamino Galvani
0f80291a93 device: fix setting MTU from connection when limited by parent
We try to set only one time the MTU from the connection to not
interfere with manual user changes.

If at some point the parent interface changes temporarily MTU to a
lower value (for example, because the connection was reactivated), the
kernel will also lower the MTU on child interface and we will not
update it ever again.

Add a workaround to this. If we detect that the MTU we want to set
from connection is higher that the allowed one, go into a state where
we follow the parent MTU until it is possible to set again the desired
MTU. This is a bit ugly, but I can't think of any nicer way to do it.

https://bugzilla.redhat.com/show_bug.cgi?id=1751079
(cherry picked from commit ec28f5b343)
(cherry picked from commit 49857ed279)
2020-03-16 11:55:02 +01:00
Beniamino Galvani
241b6f773f macvlan: update MTU according to parent's one
(cherry picked from commit 4875745bc0)
(cherry picked from commit 9133ba9003)
2020-03-16 11:55:00 +01:00
Beniamino Galvani
24fae58dd8 macsec: update MTU according to parent's one
A MACsec connection doesn't have an ordering dependency with its
parent connection and so it's possible that the parent gets activated
later and sets a greater MTU than the original one.

It is reasonable and useful to keep the MACsec MTU configured by
default as the maximum allowed by the parent interface, that is the
parent MTU minus the encapsulation overhead (32). The user can of
course override this by setting an explicit value in the
connection. We already do something similar for VLANs.

https://bugzilla.redhat.com/show_bug.cgi?id=1723690
(cherry picked from commit 438a0a9ad5)
(cherry picked from commit c58ce8945d)
2020-03-16 11:54:59 +01:00
Beniamino Galvani
bbd5802f00 device: introduce generic function to inherit MTU from parent
Introduce a generic function to set a MTU based on parent's one. Also
define a device-specific @mtu_parent_delta value that specifies the
difference from parent MTU that should be set by default. For VLAN it
is zero but other interface types (for example MACsec) require a
positive value due to encapsulation overhead.

(cherry picked from commit 5cf57f4522)
(cherry picked from commit 73597864bb)
2020-03-16 11:54:54 +01:00
Beniamino Galvani
da40a78e65 device: expand comment on MTU selection
(cherry picked from commit 6455a4e528)
(cherry picked from commit 37720d856a)
2020-03-16 11:54:52 +01:00
Beniamino Galvani
bd6f42f300 device: reset ip6_mtu on cleanup
ip6_mtu contains the MTU received through IPv6 autoconfiguration; it
should be reset when the connection is deactivated.

https://bugzilla.redhat.com/show_bug.cgi?id=1753128
(cherry picked from commit 353c7c95c1)
(cherry picked from commit f35783c3fb)
2020-03-16 11:54:48 +01:00
Thomas Haller
ab50a0ccc4 ifcfg: merge branch 'th/ifcfg-8021x-system-ca-certs'
(cherry picked from commit c1dca47619)
(cherry picked from commit 361251989f)
2020-03-14 09:48:32 +01:00
Thomas Haller
e18868a19b ifcfg: various cleanup in ifcfg writer
svUnsetValue (ifcfg, KEY);
    if (condition)
         svSetValue* (ifcfg, KEY, ...);

is not good. It requires first clearing the value, before setting
it again.

Various cleanup to fix such uses.

(cherry picked from commit 5028206ec4)
(cherry picked from commit b67983c387)
2020-03-14 09:46:44 +01:00
Thomas Haller
73de171aac ifcfg: add support for "802-1x.system-ca-certs" setting
(cherry picked from commit 2a4fb75d3b)
(cherry picked from commit d0572b6602)
2020-03-14 09:46:13 +01:00
Thomas Haller
28b159eeaf ifcfg: add svSetValueBoolean_cond_true() helper
(cherry picked from commit 87af96a9d6)
(cherry picked from commit f449ace2f1)
2020-03-14 09:46:13 +01:00
Thomas Haller
57e2f76f57 supplicant: fix memory corruption with wrong argument to NM_SUPPLICANT_INTERFACE_GROUP_FORMATION_FAILURE signal
The signal is unused (and should be removed).

Still, the parameter passed to g_signal_emit() is a C string, not a
GVariant. I think as there are no subscribers, glib wouldn't actually
do anything with the arguments. Though, I am not sure whether glib still
tries to initialize a GValue with a GVariant type, leading to a crash.

Fixes: f05b7a78c9 ('supplicant: Track P2P Group information, creation and destruction')
(cherry picked from commit c106008091)
(cherry picked from commit 26d6ac5385)
(cherry picked from commit dc9322c0a9)
2020-01-30 11:46:23 +01:00
Will Dietz
605262e4d7 build/meson: fix missing slash when detecting resolvconf/netconfig binaries
Fix detection for /usr/local/sbin/{resolvconf,netconfig}.
(and no longer automatically use "/usr/local/sbinnetconfig" if present)

Fixes: 5a0cef2f36 ('build: meson: uniform handling of rc managers')

[thaller@redhat.com: commit message adjusted]

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/349
(cherry picked from commit 2b17f246f0)
(cherry picked from commit 00feb26d70)
(cherry picked from commit 74eeb1d2cd)
2020-01-28 16:13:21 +01:00