Commit graph

23956 commits

Author SHA1 Message Date
Thomas Haller
bbc8e09dc8 core: fix passing current enum value to nm_config_data_get_value() in _init_nm_debug()
Fixes: c7d2e1f3bc ('config: drop nm_config_get_debug() and access config directly')
2020-04-20 09:02:40 +02:00
Beniamino Galvani
fb4d8705dd all: remove wrong CURL option initialization
curl_multi_setopt() accepts CURLMOPT_* options, not CURLOPT_*
ones. Found by GCC 10:

clients/cloud-setup/nm-http-client.c:700:38: error: implicit conversion from ‘enum <anonymous>’ to ‘CURLMoption’ [-Werror=enum-conversion]
  700 |    curl_multi_setopt (priv->mhandle, CURLOPT_VERBOSE, 1);

Fixes: 69f048bf0c ('cloud-setup: add tool for automatic IP configuration in cloud')
(cherry picked from commit c11ac34f4c)
(cherry picked from commit 7ba2040caa)
2020-04-20 08:26:33 +02:00
Thomas Haller
6f39520ee9 connectivity: fix using curl_multi_strerror() for CURLMcode error code
(cherry picked from commit c24f122e22)
2020-04-20 08:24:48 +02:00
Beniamino Galvani
0ed3711f5c n-dhcp4: fix initialization of the 'secs' DHCP header field
Due to wrong type conversions, the value was always zero.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/341
(cherry picked from commit df6129d93a)
(cherry picked from commit ff7545704e)
2020-04-20 08:06:49 +02:00
Beniamino Galvani
ef3c1a1602 n-dhcp4: fix uninitialized variable
Properly initialize 'overload' when the space in the file section
ends.

 shared/n-dhcp4/src/n-dhcp4-outgoing.c: In function ‘n_dhcp4_outgoing_append’:
 shared/n-dhcp4/src/n-dhcp4-outgoing.c:198:17: error: ‘overload’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

(cherry picked from commit b2620e798a)
(cherry picked from commit 972b0db460)
2020-04-20 08:04:46 +02:00
Thomas Haller
f7b9d06306 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)
2020-04-20 07:44:14 +02:00
Thomas Haller
b474ed0044 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)
2020-04-20 07:44:07 +02:00
Beniamino Galvani
5d797b91e4 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)
2020-04-20 07:33:17 +02:00
Thomas Haller
4fb9f98bc6 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)
2020-04-20 07:33:17 +02:00
Thomas Haller
e573f77855 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)
2020-04-19 21:58:36 +02:00
Thomas Haller
ceb602cab1 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)
2020-04-19 21:58:06 +02:00
Thomas Haller
cca752af94 contrib/rpm: use proper check for nmtui conditional build
(cherry picked from commit 0f4819ab36)
2020-04-19 21:55:59 +02:00
Thomas Haller
71d4e261f6 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)
2020-04-19 21:55:15 +02:00
Thomas Haller
3fcc337770 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)
2020-04-19 21:55:09 +02:00
Thomas Haller
43aa1f7ff1 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)
2020-04-19 21:53:54 +02:00
Thomas Haller
3199349196 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)
2020-04-19 21:50:39 +02:00
Thomas Haller
e79ce721d3 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)
2020-04-19 21:50:34 +02:00
Thomas Haller
c553c2ff3f 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)
2020-04-19 21:50:19 +02:00
Thomas Haller
df61b7b170 gitlab-ci: add "t_fedora:32" and by default build on Fedora 31
(cherry picked from commit ec8068ec0c)
(cherry picked from commit f1a4961def)
2020-04-19 21:50:09 +02:00
Thomas Haller
4587b96cb2 gitlab-ci: fix generating "pages" after switching to Fedora 30 for main build
(cherry picked from commit c15682558c)
(cherry picked from commit 4ea999ac94)
2020-04-19 21:49:47 +02:00
Thomas Haller
e1acac6311 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)
2020-04-16 09:48:21 +02:00
Thomas Haller
b82a8e4e01 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)
2020-04-16 09:48:21 +02:00
Thomas Haller
0a10468d79 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)
2020-04-02 09:52:27 +02:00
Thomas Haller
477c6c3e70 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)
2020-04-02 09:37:35 +02:00
Thomas Haller
56c653eca5 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)
2020-03-23 13:33:16 +01:00
Thomas Haller
76fedd150b man: improve manual page for nm-online
https://bugzilla.redhat.com/show_bug.cgi?id=1706646

(cherry picked from commit b2a0738765)
(cherry picked from commit 4b07cb9d3c)
2020-03-17 13:40:54 +01:00
Beniamino Galvani
e849f540ec Revert "dispatcher/systemd: order NetworkManager-dispatcher.service Before=NetworkManager.service"
The 'Before' dependency between NM-dispatcher and NM causes a deadlock
when stopping the NM service. When terminating, NM wants to D-Bus
activate NM-dispatcher to synchronously handle pre-down events; but
NM-dispatcher start is ordered after NM shutdown due to the following
behavior described in systemd.unit(5) man page:

  Given two units with any ordering dependency between them, if one
  unit is shut down and the other is started up, the shutdown is
  ordered before the start-up. It doesn't matter if the ordering
  dependency is After= or Before=, in this case. It also doesn't
  matter which of the two is shut down, as long as one is shut down
  and the other is started up; the shutdown is ordered before the
  start-up in all cases.

So, NM is waiting NM-dispatcher to start and NM-dispatcher is queued
by systemd, waiting that NM is stopped. The result is a 90 seconds
delay, after which systemd kills NM and continues.

The dependency was added so that during shutdown NM-dispatcher would
be stopped after NM. I don't think it worked as expected because
NM-dispatcher is not supposed to be active most of the times, and so
it doesn't need a dependency that delays its stop after NM.

This reverts commit acc335aad4.

(cherry picked from commit 105abf27c1)
(cherry picked from commit 08e8afcf17)
2020-03-02 17:51:16 +01:00
Beniamino Galvani
eee2224779 Revert "core: create virtual device on settings changes in idle handler"
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 c163207b07.

(cherry picked from commit efc04b1285)
(cherry picked from commit 987c1d282a)
2020-02-26 15:00:15 +01:00
Beniamino Galvani
ee8ae9ae43 dhcp: merge branch 'bg/dhcp-invalid-hostname'
https://bugzilla.redhat.com/show_bug.cgi?id=1744427
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/310
(cherry picked from commit a5f22dbc5d)
2020-02-10 09:44:20 +01:00
Beniamino Galvani
9c7859d05b dhcp: ignore hostname when invalid
The hostname used for DHCP can be the one obtained from the hostnamed
service and is not guaranteed to be valid, at least with systemd
239. Instead of sending an invalid DHCP option to the server or
failing due to later checks in clients, ignore the hostname and log a
warning when it is invalid.

https://bugzilla.redhat.com/show_bug.cgi?id=1744427
(cherry picked from commit 2da4d54ac3)
2020-02-10 09:44:03 +01:00
Beniamino Galvani
7a08b29a3d shared: export systemd dns and hostname validation functions
(cherry picked from commit 38f942e038)
2020-02-10 09:44:01 +01:00
Beniamino Galvani
fddc57d60a shared: fix function return value
(cherry picked from commit 319a39cac6)
2020-02-10 09:44:00 +01:00
Thomas Haller
dc9322c0a9 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)
2020-01-30 11:45:49 +01:00
Will Dietz
74eeb1d2cd 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)
2020-01-28 16:12:59 +01:00
Antonio Cardace
ee7bbddb6f release: bump version to 1.20.11 (development) 2020-01-09 18:18:40 +01:00
Antonio Cardace
d4030b240e release: bump version to 1.20.10 2020-01-09 18:17:51 +01:00
Antonio Cardace
023fd136d1 release: update NEWS 2020-01-09 18:16:10 +01:00
Thomas Haller
fff235e3a5 device/wifi: fix memleak parsing SSID arguments for "RequestScan"
Oddly enough, valgrind was not complaining about this leak...

Fixes: 87b2d783b6 ('core: accept 'ssids':aay option in RequestScan() dictionary parameter')
(cherry picked from commit 5ed1edc02a)
(cherry picked from commit 568c19f07d)
2020-01-08 13:22:27 +01:00
Andika Triwidada
66108969e2 po: update Indonesian (id) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/380
2020-01-02 09:52:42 +01:00
Beniamino Galvani
cbb1ad1ba7 manager: create a virtual device only if the connection can autoconnect
The autoconnection for virtual devices currently works in two
phases. First we detect that there is suitable profile that can
autoconnect and we realize the device. Then, when the device becomes
'disconnected', autoconnect kicks in and starts the activation.

However, if autoconnect is blocked for a device, currently we do step
1 without step 2, leaving a stale interface around. Fix this by also
checking that autoconnect is not blocked during step 1.

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

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/360
(cherry picked from commit 6c716912eb)
(cherry picked from commit 944ff9f9dc)
2019-12-24 09:21:46 +01:00
Piotr Drąg
e6a06fd68e po: update Polish (pl) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/371
2019-12-22 08:12:03 +01:00
Thomas Haller
2f62e30b7c libnm: fix type annotation for nm_sriov_vf_get_vlan_ids()
Otherwise, this function cannot really be used via generated bindings.
Also, it's the only way to actually retrieve the set vlan-ids, without
it, you wouldn't know which ones are set.

Fixes: a9b4532fa7 ('libnm-core: add SR-IOV setting')
(cherry picked from commit c4a728217d)
(cherry picked from commit 49376697c6)
2019-12-20 14:53:24 +01:00
Beniamino Galvani
bfece9d4fc dhcp: nettools: fix parsing of search domains option
'first' was never modified and so the dot was never added.

Fixes: 6adade6f21 ('dhcp: add nettools dhcp4 client')

https://bugzilla.redhat.com/show_bug.cgi?id=1783981
(cherry picked from commit 9aa00a8a14)
(cherry picked from commit ea22135384)
2019-12-17 14:36:23 +01:00
Thomas Haller
f200573a95 all: fix wrong "gs_free GError *" declarations
This is a bug and leads either to a leak or a crash.

(cherry picked from commit 4a3ca7115a)
(cherry picked from commit 809d70ee64)
2019-12-16 17:46:59 +01:00
Thomas Haller
00cf235a7a checkpatch: catch "gs_free GError *" declations
(cherry picked from commit ec0adbfaf0)
(cherry picked from commit 2fa4827eb9)
2019-12-16 17:46:10 +01:00
Beniamino Galvani
a3ed90bdbc device: don't reapply IP configuration if the ifindex is missing
Assertions will fail in ip_config_merge_and_apply() if the device
doesn't have an ifindex. Reproducible with:

 $ nmcli connection add type ovs-bridge ifname ovs0 ipv4.method disabled ipv6.method disabled
 Connection 'ovs-bridge-ovs0' (1d5e794b-10ad-4b2b-aa7c-5ca7e34b0a55) successfully added

 $ nmcli device reapply ovs0
 Error: Reapplying connection to device '(null)' (/org/freedesktop/NetworkManager/Devices/16) failed: Remote peer disconnected

 $ journalctl -u NetworkManager -e
 ...
 NetworkManager[73824]: nm_ip4_config_add_dependent_routes: assertion 'ifindex > 0' failed
 systemd[1]: NetworkManager.service: Main process exited, code=dumped, status=5/TRAP
 ...

(cherry picked from commit 6d6e1402dc)
(cherry picked from commit f1d4853927)
2019-12-14 21:08:27 +01:00
Beniamino Galvani
65d37a3bfa ovs: check state before starting ip configuration after link change
When the link becomes available, check that the device is in the
ip-config state before starting ip configuration. Also, reset the
'waiting_for_interface' flag when the device deactivates.

https://bugzilla.redhat.com/show_bug.cgi?id=1781165
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/358
(cherry picked from commit 0738c10445)
(cherry picked from commit 3381299562)
2019-12-14 21:08:26 +01:00
Beniamino Galvani
74649429df 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)
2019-12-11 13:55:32 +01:00
Beniamino Galvani
269deeebf8 merge: branch 'bg/mtu-reapply-rh1779162'
https://bugzilla.redhat.com/show_bug.cgi?id=1779162
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/356
(cherry picked from commit ce2cceef83)
(cherry picked from commit 73a2557a6f)
2019-12-11 13:54:49 +01:00
Beniamino Galvani
0064401e35 device: always allow reapply of MTU from wired setting
Many device types take the MTU value from the wired setting; usually
they don't implement the can_reapply_change() method and so the MTU
can't be changed with the Reapply() API.

Instead of implementing the method for all such devices to support the
same property (adding a lot of duplicated code), add a check in
NMDevice to allow the reapply of MTU when we recognize that the device
uses the MTU from the wired setting.

Device types can still decide to implement can_reapply_change() and
support whatever properties they want, even from the wired setting.

(cherry picked from commit 9339d3310e)
(cherry picked from commit 1191eba15a)
2019-12-11 13:54:35 +01:00