Commit graph

21513 commits

Author SHA1 Message Date
Beniamino Galvani
d1dfeb4a5f ovs: allow changing mac address of bridges and interfaces
Allow changing the cloned MAC address for OVS bridges and
interfaces. The MAC address set on the bridge is propagated by ovs to
the local interface (the one with the same name as the bridge), while
all other internal interfaces use the address defined in the interface
connection.

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

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/321
(cherry picked from commit 101e65d2bb)
(cherry picked from commit b366234a3a)
(cherry picked from commit 5a4a5f637b)
(cherry picked from commit 46bb51d3d6)
2020-01-15 09:18:06 +01:00
Beniamino Galvani
0301b55a71 ovs: fix memory leak
(cherry picked from commit 508c7679cf)
(cherry picked from commit ad17cfff24)
(cherry picked from commit 836b9e24a4)
(cherry picked from commit adc76d28c9)
2020-01-15 09:18:04 +01:00
Beniamino Galvani
864307dc26 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)
(cherry picked from commit cbb1ad1ba7)
(cherry picked from commit dc03a26494)
(cherry picked from commit 1158d01926)
2019-12-24 09:31:29 +01:00
Thomas Haller
e623db57d0 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)
(cherry picked from commit 2f62e30b7c)
(cherry picked from commit a8746f48ca)
(cherry picked from commit abd4cde102)
2019-12-20 14:54:38 +01:00
Beniamino Galvani
e174a420fa wifi: allow reapply when the seen-bssids property changed
wifi.seen-bssid is a synthetic read-only property that lists all the
bssids seen for that connection; it should be ignored during a
reapply.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/243
(cherry picked from commit 8cd8a5fbed)
(cherry picked from commit 81cc4ddb1a)
(cherry picked from commit ade9864366)
(cherry picked from commit ea30bffbb5)
2019-09-13 14:34:45 +02:00
Beniamino Galvani
481b7fe3fb libnm-core: fix ifcfg-rh variable name for DHCPv6 hostname
Fixes: 2852b50945 ('ifcfg-rh: add DHCPV6_HOSTNAME and DHCPV6_SEND_HOSTNAME vars')
(cherry picked from commit 657b8b31b0)
(cherry picked from commit df5d76b0dc)
(cherry picked from commit 7f532e9ab5)
(cherry picked from commit 98c019f708)
2019-08-05 16:04:56 +02:00
Beniamino Galvani
05858995d1 merge: branch 'bg/ovs-restart-part2-rh1733709'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/216

https://bugzilla.redhat.com/show_bug.cgi?id=1733709
(cherry picked from commit 5f668b81d3)
(cherry picked from commit 0581a53a46)
(cherry picked from commit e066ac5545)
(cherry picked from commit ba48493987)
2019-08-01 10:33:31 +02:00
Beniamino Galvani
f568538904 device: fix releasing slaves
Not all masters type have a platform link and so it's wrong to check
for it to decide whether the slave should be really released. Move the
check to master devices that need it (bond, bridge and team).

OVS ports don't need the check because they don't call to platform to
remove a slave.

https://bugzilla.redhat.com/show_bug.cgi?id=1733709
(cherry picked from commit 57e3734b6c)
(cherry picked from commit ec1b5fb019)
(cherry picked from commit f6a90b899a)
(cherry picked from commit af2a126dc0)
2019-08-01 10:32:36 +02:00
Beniamino Galvani
1240565e48 device: check platform link compatibility when setting nm-owned flag
We set nm-owned to indicate whether a software device was created by
NM or it was pre-existing. When checking the existence, we must verify
also whether the link type is compatible with the device, otherwise it
is possible to match unrelated interfaces. For example, when checking
for the existence of an ovs-bridge (which is not compatible with any
platform link) we could match a unrelated platform link with the same
name.

https://bugzilla.redhat.com/show_bug.cgi?id=1733709
(cherry picked from commit 3cb4b36261)
(cherry picked from commit cb20d0791a)
(cherry picked from commit 511ef27d5e)
(cherry picked from commit 33309f7c9f)
2019-08-01 10:26:57 +02:00
Beniamino Galvani
647c054bce ovs: don't release slaves on quit
An OVS bridge and its slaves can continue to work even after NM has
quit. Keep the interface enslaved when the @configure argument of
device->release_slave() is FALSE, which happens on quit and in other
circumstances when we don't really want to release the slave from its
master.

https://bugzilla.redhat.com/show_bug.cgi?id=1733709
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/215
(cherry picked from commit ccd4be4014)
(cherry picked from commit a1f39b69e0)
(cherry picked from commit f93018a41a)
2019-08-01 10:26:01 +02:00
Thomas Haller
ef5c7dc0eb platform/netlink: mark nested netlink attribute with NLA_F_NESTED
Kernel 5.2 is adding stricter checking for netlink messages.
In particular, for certain API it checks now that NLA_F_NESTED flag is
set for nested attributes ([1]).

Note that libnl3 does not ever set this flag, and since our netlink
implementation is copied from there, certain netlink messages are now
rejected as invalid.

On the other hand, libmnl always adds this flag ([2]). So we should do that
as well.

In particular, this affects the WireGuard netlink API causing request
from NetworkManager to be rejected ([3]).

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b424e432e770d6dd572765459d5b6a96a19c5286
[2] https://git.netfilter.org/libmnl/tree/src/attr.c?id=5937dfcb0185f5cb9cf275992ea701ec4e619d9c#n535
[3] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/212

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/210
(cherry picked from commit 7811d1c187)
(cherry picked from commit 57048338ee)
(cherry picked from commit 52b52d2f7d)
2019-07-23 14:45:57 +02:00
Marco Trevisan (Treviño)
f66040cc16 device: free temporary typename with iface variable
To create a disambiguated name for some Bluetooth devices we use its type name
with iface, however this value is allocated but never free'd when passed to
g_strdup_printf.

So use instead a temporary variable and free it once done.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/208

Fixes: 8bbda5cdff
(cherry picked from commit b621aba5c2)
(cherry picked from commit 64ed96fb5f)
(cherry picked from commit 6156720c0d)
2019-07-22 08:32:23 +02:00
Thomas Haller
b1209e37db device: fix reapplying changes to connection ID and UUID
4 properties are not really relevant for an already activated connection
or it makes not sense to change them. These are connection.id, connection.uuid,
connection.autoconnect and connection.stable-id.

For convenience, we allow to reapply these. This way, one can take
a different setting (e.g. with a different connection.id or
connection.uuid) and reapply them, but such changes are silently
ignored.

However this was done wrongly. Instead of reverting the change to the new
applied connection, we would change the input connection.

This is bad, for example with

  nmcli connection up uuid cb922f18-e99a-49c6-b200-1678b5070a82
  nmcli connection modify cb922f18-e99a-49c6-b200-1678b5070a82 con-name "bogus"
  nmcli device reapply eth0

the last re-apply would reset the settings-connection's connection ID to
what was before, while accepting the new name on the applied-connection
(while it should have been rejected).

Fixes: bf3b3d444c ('device: avoid changing immutable properties during reapply')

(cherry picked from commit adb51c2a7f)
(cherry picked from commit 09f37d5bd4)
(cherry picked from commit 9c72ca5ee9)
2019-07-18 12:21:26 +02:00
Thomas Haller
8f85b6a3af core: fix mangling static IPv6 routes in nm_ip6_config_merge_setting()
https://bugzilla.redhat.com/show_bug.cgi?id=1727193

Fixes: 433d2f8659 ('core: merge IPv4 and IPv6 version of _nm_ip_config_merge_route_attributes()')
(cherry picked from commit a8fa015a4e)
(cherry picked from commit 44e4ed1e95)
(cherry picked from commit d3b7b0d286)
2019-07-09 14:35:56 +02:00
Beniamino Galvani
b44e473164 ifcfg-rh: fix memory leak reading infiniband setting
(cherry picked from commit c045267837)
(cherry picked from commit 4150dd8c43)
(cherry picked from commit 4aa2773f54)
2019-07-04 11:56:51 +02:00
Beniamino Galvani
b8e87a7098 device: ppp: check that connection has a PPPoE parent
NMDevicePPP only handles connections with the pppoe.parent property
set. match_connection() already checks this when we creating a new
device. We should also perform the same check in
check_connection_compatible().

Fixes: 6c3195931e ('core: implement activation of PPP devices')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/203
(cherry picked from commit 17f4a1e794)
(cherry picked from commit 5ca888d693)
(cherry picked from commit ae4e82c30f)
2019-07-03 18:07:47 +02:00
Beniamino Galvani
449538d860 clients: fix printing hexadecimal enum values
Use the 'x' conversion specifier for hexadecimal numbers.

Fixes: f53218ed7c ('cli: add property type for enum and showcase for ipv6.addr-gen-mode'):
(cherry picked from commit 420554a72e)
(cherry picked from commit 9fe7ef6ca3)
(cherry picked from commit d4141a1806)
2019-06-27 17:25:17 +02:00
Thomas Haller
0c9a6ff0ba libnm: belatedly expose nm_ethtool_optname_is_feature() in libnm
Also, plan right away to backport this symbol all the way back to
1.14.8. As such, we only need to add it once, with the right linker
version "libnm_1_14_8".

But still, the symbols first appears on a major release 1.20.0.

(cherry picked from commit a4c1489507)
(cherry picked from commit a7322eaa5d)
(cherry picked from commit ad6eaa0856)
2019-06-11 15:47:06 +02:00
Thomas Haller
d3ef0ee871 version: add NM_AVAILABLE_IN_1_14_8 macro 2019-06-11 15:47:06 +02:00
Beniamino Galvani
f6b51bb8ea team: don't kill teamd for external devices
The teamd instance must not be killed if the device was externally
activated.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/158
https://bugzilla.redhat.com/show_bug.cgi?id=1693142
(cherry picked from commit 008a4b4215)
(cherry picked from commit bd113fe72e)
(cherry picked from commit c71b47268f)
2019-05-20 15:01:40 +02:00
Patrick J. Volkerding
fb8d30a3dd hostname-manager: use fqdn for persistent hostname on Slackware
This will be the default for Slackware 15.0 and on.

This should be safe for both master and 1.12.x stable branch, as
no existing Slackware releases are expected to run NM-1.12.x or
later.

Signed-off-by: Robby Workman <rworkman@slackware.com>

https://mail.gnome.org/archives/networkmanager-list/2019-May/msg00011.html

(cherry picked from commit e1df17e0ac)
(cherry picked from commit 065e810424)
(cherry picked from commit 6160888e61)
2019-05-19 10:49:01 +02:00
Thomas Haller
869ac551cf core: fix file permissions for "/var/lib/NetworkManager/secret_key"
Ooherwise, the file has wrong permissions:

  # ls -la /var/lib/NetworkManager/secret_key
  ----r-xr-x. 1 root root 50 May 14 13:52 /var/lib/NetworkManager/secret_key

Luckily, /var/lib/NetworkManager should be already

  # ls -lad /var/lib/NetworkManager
  drwx------. 2 root root 8192 May 14 13:57 /var/lib/NetworkManager

which mitigates this a bit.

Fixes: dbcb1d6d97 ('core: let nm_utils_secret_key_read() handle failures internally')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/175
(cherry picked from commit dc3a2f9bc4)
(cherry picked from commit 2d46247c6a)
(cherry picked from commit 7a0f8520ff)
2019-05-14 14:05:11 +02:00
Thomas Haller
703864e2b3 settings/d-bus: fix boolean return value of "LoadConnections"
The boolean value is intended to indicate success. It would indicated
failure due to a bug.

Fixes: 297d4985ab ('core/dbus: rework D-Bus implementation to use lower layer GDBusConnection API'):
(cherry picked from commit 22e830f046)
(cherry picked from commit e73a505866)
(cherry picked from commit 1337ebd9d0)
2019-05-10 15:40:28 +02:00
Thomas Haller
6052b86304 settings: avoid assertion for LoadConnections D-Bus method with relative paths
$ busctl call org.freedesktop.NetworkManager /org/freedesktop/NetworkManager/Settings org.freedesktop.NetworkManager.Settings LoadConnections as 1 relative/filename

triggers a g_critical() assertion in nm_utils_file_is_in_path():

  ...
  #3  0x00007ffff7a19e7d in g_return_if_fail_warning
      (log_domain=log_domain@entry=0x55555586c333 "NetworkManager", pretty_function=pretty_function@entry=0x55555586c0a0 <__FUNCTION__.38585> "nm_utils_file_is_in_path", expression=expression@entry=0x55555586c010 "abs_filename && abs_filename[0] == '/'") at ../glib/gmessages.c:2767
  #4  0x00005555555f1128 in nm_utils_file_is_in_path (abs_filename=abs_filename@entry=0x555555b56670 "dfd", abs_path=<optimized out>) at src/NetworkManagerUtils.c:1077
  #5  0x00005555555a4779 in load_connection (config=<optimized out>, filename=0x555555b56670 "dfd") at src/settings/plugins/keyfile/nms-keyfile-plugin.c:522
  #6  0x00005555557ce291 in nm_settings_plugin_load_connection (self=0x5555559fd400 [NMSKeyfilePlugin], filename=0x555555b56670 "dfd") at src/settings/nm-settings-plugin.c:70
  #7  0x000055555559ccdf in impl_settings_load_connections
      (obj=<optimized out>, interface_info=<optimized out>, method_info=<optimized out>, connection=<optimized out>, sender=<optimized out>, invocation=0x7fffe0015ed0 [GDBusMethodInvocation], parameters=<optimized out>) at src/settings/nm-settings.c:1439
  #8  0x00005555555a9bf9 in dbus_vtable_method_call
      (connection=0x5555559b91b0 [GDBusConnection], sender=sender@entry=0x555555b5c360 ":1.32283", object_path=object_path@entry=0x7fffe0019070 "/org/freedesktop/NetworkManager/Settings", interface_name=<optimized out>, interface_name@entry=0x7fffe002aa70 "org.freedesktop.NetworkManager.Settings", method_name=<optimized out>,
      method_name@entry=0x7fffe00276b0 "LoadConnections", parameters=parameters@entry=0x555555c4a690, invocation=0x7fffe0015ed0 [GDBusMethodInvocation], user_data=0x5555559a1a00)
      at src/nm-dbus-manager.c:947
  #9  0x00007ffff7c506c4 in call_in_idle_cb (user_data=user_data@entry=0x7fffe0015ed0) at ../gio/gdbusconnection.c:4874
  #10 0x00007ffff7a0e8eb in g_idle_dispatch (source=source@entry=0x7fffe00208a0, callback=0x7ffff7c50590 <call_in_idle_cb>, user_data=0x7fffe0015ed0) at ../glib/gmain.c:5627
  #11 0x00007ffff7a11fd0 in g_main_dispatch (context=0x555555994d00) at ../glib/gmain.c:3189
  #12 0x00007ffff7a11fd0 in g_main_context_dispatch (context=context@entry=0x555555994d00) at ../glib/gmain.c:3854
  #13 0x00007ffff7a12368 in g_main_context_iterate (context=0x555555994d00, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:3927
  #14 0x00007ffff7a126b3 in g_main_loop_run (loop=0x555555995e60) at ../glib/gmain.c:4123
  #15 0x000055555558a741 in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:444

Filter out relative filenames early.

(cherry picked from commit a1b102eae4)
(cherry picked from commit c21171e069)
(cherry picked from commit 8fe900d323)
2019-05-10 15:02:23 +02:00
Thomas Haller
88c9767da7 platform: fix nm_platform_lnk_gre_to_string() for tap links
Why didn't we get a compiler warning about this bug?
At least clang (3.8.0-2ubuntu4, Ubuntu 16.04) warns:

    CC       src/platform/src_libNetworkManagerBase_la-nm-platform.lo
  ../src/platform/nm-platform.c:5389:14: error: data argument not used by format string [-Werror,-Wformat-extra-args]
                      lnk->remote ? nm_sprintf_buf (str_remote, " remote %s", nm_utils_inet4_ntop (lnk->remote, str_remote1)) : "",
                      ^

Fixes: 4c2862b958 ('platform: add gretap tunnels support')
(cherry picked from commit dfb899f465)
(cherry picked from commit ed88c71f15)
(cherry picked from commit 400293d350)
2019-04-18 20:21:44 +02:00
Beniamino Galvani
c780befe0c team: clean up state when connection to teamd fails
If NM fails to connect to teamd, it currently just sets the device
state to FAILED and waits that deactivate() is called later. However,
the 5 seconds timeout on teamd process start can hit in the meantime,
which fails with an assertion "nm_device_is_activating (device)".

Clean up the device state when the connection to teamd fails.

https://bugzilla.redhat.com/show_bug.cgi?id=1697900
(cherry picked from commit c48698d747)
(cherry picked from commit 43571d1013)
2019-04-10 08:47:39 +02:00
Beniamino Galvani
76c283aed9 libnm-core: fix invalid memory access
When we delete the runner.name property, the runner object itself gets
deleted if that was the only property, and @runner becomes invalid.

 ==13818== Invalid read of size 1
 ==13818==    at 0x55EAF4: nm_streq (nm-macros-internal.h:869)
 ==13818==    by 0x55EAF4: _json_team_normalize_defaults (nm-utils.c:5573)
 ==13818==    by 0x566C89: _nm_utils_team_config_set (nm-utils.c:6057)
 ==13818==    by 0x5498A6: _nm_utils_json_append_gvalue (nm-utils-private.h:228)
 ==13818==    by 0x5498A6: set_property (nm-setting-team.c:1622)
 ==13818==  Address 0x182a9330 is 0 bytes inside a block of size 13 free'd
 ==13818==    at 0x4839A0C: free (vg_replace_malloc.c:530)
 ==13818==    by 0x4857868: json_delete_string (value.c:763)
 ==13818==    by 0x4857868: json_delete (value.c:975)
 ==13818==    by 0x4851FA1: UnknownInlinedFun (jansson.h:129)
 ==13818==    by 0x4851FA1: hashtable_do_del (hashtable.c:131)
 ==13818==    by 0x4851FA1: hashtable_del (hashtable.c:289)
 ==13818==    by 0x55DFDD: _json_del_object (nm-utils.c:5384)
 ==13818==    by 0x55EA70: _json_delete_object_on_string_match (nm-utils.c:5532)
 ==13818==    by 0x55EADB: _json_team_normalize_defaults (nm-utils.c:5549)
 ==13818==    by 0x566C89: _nm_utils_team_config_set (nm-utils.c:6057)
 ==13818==    by 0x5498A6: _nm_utils_json_append_gvalue (nm-utils-private.h:228)
 ==13818==    by 0x5498A6: set_property (nm-setting-team.c:1622)
 ==13818==  Block was alloc'd at
 ==13818==    at 0x483880B: malloc (vg_replace_malloc.c:299)
 ==13818==    by 0x4852E8C: lex_scan_string (load.c:389)
 ==13818==    by 0x4852E8C: lex_scan (load.c:620)
 ==13818==    by 0x4853458: parse_object (load.c:738)
 ==13818==    by 0x4853458: parse_value (load.c:862)
 ==13818==    by 0x4853466: parse_object (load.c:739)
 ==13818==    by 0x4853466: parse_value (load.c:862)
 ==13818==    by 0x4853655: parse_json.constprop.7 (load.c:899)
 ==13818==    by 0x48537CF: json_loads (load.c:959)
 ==13818==    by 0x566780: _nm_utils_team_config_set (nm-utils.c:5961)
 ==13818==    by 0x5498A6: _nm_utils_json_append_gvalue (nm-utils-private.h:228)
 ==13818==    by 0x5498A6: set_property (nm-setting-team.c:1622)

Fixes: a5642fd93a ('libnm-core: team: rework defaults management on runner properties')
(cherry picked from commit 80a3031a7c)
(cherry picked from commit 3fa39f6112)
2019-04-09 09:48:43 +02:00
Yupeng Chang
8494b87d40 ifupdown: fix connection iterator
Fixes: 6aa66426a4 ('settings/ifupdown: merge eni_ifaces and connections hashes in plugin')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/145
https://bugzilla.redhat.com/show_bug.cgi?id=1694912
(cherry picked from commit 1dd67583e3)
(cherry picked from commit 00858afc4f)
2019-04-02 11:45:23 +02:00
Beniamino Galvani
13ac745b8f build: fix searching dlopen in configure
The 4th argument of AC_SEARCH_LIBS is a list of additional libraries,
not the name of the variable to hold the result which is always
ac_cv_search_$function. Also, we should ignore the result when it is
"none required".

Fixes: 1f2eeb85d8 ('build: rename $(LIBDL) to $(DL_LIBS) and modify detection')
(cherry picked from commit bd4957fcd7)
(cherry picked from commit 1fa0914b17)
2019-03-31 12:13:48 +02:00
Beniamino Galvani
873d4e8952 dns: fix memory leak of error
The error was leaked when cancelled.

Fixes: 818023c257 ('dns/resolved: add systemd-resolved backend')
(cherry picked from commit 579373a5df)
(cherry picked from commit 065fa28373)
2019-03-26 17:44:23 +01:00
Beniamino Galvani
37586cada6 libnm: fix dns-configuration property type
Fixes: a8d6005256 ('libnm: implement support for DNS manager properties')

https://bugzilla.redhat.com/show_bug.cgi?id=1689055
(cherry picked from commit d867837d05)
(cherry picked from commit 47f1c931ee)
2019-03-15 11:18:06 +01:00
Thomas Haller
d160b7b990 shared/systemd: fix gettid() compat implementation shadowing function from glibc
On Fedora rawhide we get the following build failure:

    In file included from shared/systemd/src/basic/alloc-util.c:3:
    ./shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h:114:21: error: static declaration of 'gettid' follows non-static declaration
      114 | static inline pid_t gettid(void) {
          |                     ^~~~~~
    In file included from /usr/include/unistd.h:1170,
                     from /usr/include/glib-2.0/gio/gcredentials.h:32,
                     from /usr/include/glib-2.0/gio/gio.h:46,
                     from ./shared/nm-utils/nm-macros-internal.h:31,
                     from ./shared/nm-default.h:293,
                     from ./shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h:22,
                     from shared/systemd/src/basic/alloc-util.c:3:
    /usr/include/bits/unistd_ext.h:34:16: note: previous declaration of 'gettid' was here
       34 | extern __pid_t gettid (void) __THROW;
          |                ^~~~~~

glibc supports now gettid() call ([1]) which conflicts with our compat
implementation. Rename it.

[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92

(cherry picked from commit 10276322bd)
(cherry picked from commit cfb970b277)
2019-03-11 19:11:33 +01:00
Lubomir Rintel
6013b2dabf wwan/ofono: pass the right argument to manager proxy callback
Otherwise it will be dereferencing NULL when invoked.

Fixes: 58712c9546 ('ofono: take D-Bus proxy for ConnectionManager asynchronously')

https://github.com/NetworkManager/NetworkManager/pull/313
(cherry picked from commit 90fe78eb7f)
(cherry picked from commit 4d4b3fc8b5)
2019-03-08 16:54:33 +01:00
Lubomir Rintel
27b75bea63 platform/linux: fix detection of IFA_FLAGS support
The condition got accidentally reversed, which means we're always
undecided and thus wrongly assuming support and never being able to set
any addresses.

This would bother the few that are struck with 3.4 android kernels. Very
few indeed, given this got unnoticed since 1.10.

Fixes: 8670aacc7c ('platform: cleanup detecting kernel support for IFA_FLAGS and IPv6LL')
(cherry picked from commit d551a0893e)
(cherry picked from commit c411b8900f)
2019-03-07 10:22:21 +01:00
Marco Trevisan (Treviño)
3e24e328a6 nm: Fix syntax on introspection annotations
Various annotations were added using multiple colons, while only one has
to be added or g-ir-introspect will consider them part of the description

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/94
(cherry picked from commit 73005fcf5b)
(cherry picked from commit b5bbf8edc2)
2019-03-07 10:11:33 +01:00
Beniamino Galvani
52f7e2d6d6 device: do ARP announcements only after masters have a slave
Delay ARP announcements for masters until the first interfaces gets
enslaved. There is no point in doing it before as the ARP packets
would be dropped in most cases; also, if the first slave is added when
we already started announcing, the MAC of the master is going to
change and so the remaining ARPs will have a wrong "sender mac
address" field.

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

https://github.com/NetworkManager/NetworkManager/pull/301
2019-03-05 11:58:17 +01:00
Thomas Haller
2b0b9122f1 build: fix build dependency for generating libnm enum headers before building nm-online
CC       clients/nm_online-nm-online.o
    In file included from ./shared/nm-default.h:311:0,
                     from clients/nm-online.c:34:
    ./libnm/NetworkManager.h:60:10: fatal error: nm-enum-types.h: No such file or directory
     #include "nm-enum-types.h"
              ^~~~~~~~~~~~~~~~~

(cherry picked from commit d8070c7a14)
(cherry picked from commit a79d9dacf1)
2019-03-05 10:28:45 +01:00
Beniamino Galvani
87c2a8339f manager: ignore ovs-system master when assuming connections
This change allows NM to assume after a restart a device that has been
enslaved externally to an ovs bridge.

https://bugzilla.redhat.com/show_bug.cgi?id=1676551
(cherry picked from commit 93bbe43695)
(cherry picked from commit 526f1476db)
2019-03-04 10:49:13 +01:00
Thomas Haller
bba4162c76 cli/tests: fix cli tests after changing Polish translations
The tests run nmcli with Polish locale and compare the output.
After modifying Polish translation we must regenerate the expected
output.

Fixes: 25d91e3b68
2019-02-27 09:20:36 +01:00
Beniamino Galvani
353743b995 supplicant: fix setting pmf when the supplicant doesn't advertise support
wpa_supplicant only advertises pmf support since commit [1], which is
after 2.6. When using a version without that commit (for example,
plain 2.6), we would unconditionally set the global Pmf property to 1
(optional) and then skip setting the per-network property. The result
was that pmf was enabled without the possibility to disable it by
user. The correct behavior is instead to disable pmf on such versions.

[1] https://w1.fi/cgit/hostap/commit/?id=3cdb4ac074f76accf24a51d143db545afad2c90b

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/129
(cherry picked from commit 560a35dd43)
(cherry picked from commit b837561bb6)
2019-02-26 19:17:34 +01:00
Piotr Drąg
25d91e3b68 po: update Polish (pl) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/90
2019-02-25 13:05:33 +01:00
Piotr Drąg
7278c0a7db Mark broken string in Japanese translation as fuzzy
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/88
2019-02-25 13:02:38 +01:00
Thomas Haller
2f2f065a43 release: bump version to 1.14.7 (development) 2019-02-23 09:07:16 +01:00
Thomas Haller
dc56a21ed6 release: bump version to 1.14.6 2019-02-23 09:07:16 +01:00
Thomas Haller
c7833ab4f7 release: update NEWS 2019-02-23 09:07:16 +01:00
Thomas Haller
4c694e46ea libnm: fix leaking checkpoints from NMManager
Fixes: c3efedf54b
(cherry picked from commit 10600bdb69)
2019-02-19 09:34:40 +01:00
Thomas Haller
38890376fb libnm: fix memleak for NMDeviceTun:hw-address
Fixes: 337304f19d
(cherry picked from commit 41ea9fffbb)
2019-02-19 09:34:39 +01:00
Thomas Haller
a505ab423e libnm: fix duplicate free in nm_client_checkpoint_rollback()
#0  0x00007fffea7481e5 in _g_log_abort (breakpoint=1) at gmessages.c:554
    #1  0x00007fffea74951d in g_logv (log_domain=0x7fffea78e00e "GLib", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffcbb0)
        at gmessages.c:1371
    #2  0x00007fffea7496f3 in g_log
        (log_domain=log_domain@entry=0x7fffea78e00e "GLib", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7fffea798320 "%s: assertion '%s' failed")
        at gmessages.c:1413
    #3  0x00007fffea749f2d in g_return_if_fail_warning
        (log_domain=log_domain@entry=0x7fffea78e00e "GLib", pretty_function=pretty_function@entry=0x7fffea799d40 <__func__.4759> "g_atomic_ref_count_dec", expression=expression@entry=0x7fffea799ca1 "g_atomic_int_get (arc) > 0") at gmessages.c:2762
    #4  0x00007fffea754c12 in g_atomic_ref_count_dec (arc=arc@entry=0x5555558c5280) at grefcount.c:260
    #5  0x00007fffea7302c6 in g_hash_table_unref (hash_table=0x5555558c5240) at ghash.c:1101
    #6  0x00007fffea4b6dbc in clear_op_res (simple=0x55555587ed90 [GSimpleAsyncResult]) at gsimpleasyncresult.c:248
    #7  0x00007fffea4b6dbc in g_simple_async_result_finalize (object=0x55555587ed90 [GSimpleAsyncResult]) at gsimpleasyncresult.c:268
    #8  0x00007fffea67b949 in g_object_unref (_object=<optimized out>) at gobject.c:3346
    #9  0x00007fffea67b949 in g_object_unref (_object=0x55555587ed90) at gobject.c:3238
    #10 0x00007fffe95dea2d in checkpoint_rollback_cb (object=<optimized out>, result=<optimized out>, user_data=0x55555587ed90) at libnm/nm-manager.c:1584
    #11 0x00007fffea4ca834 in g_task_return_now (task=0x5555558b5c80 [GTask]) at gtask.c:1148
    #12 0x00007fffea4cb196 in g_task_return (task=0x5555558b5c80 [GTask], type=<optimized out>) at gtask.c:1206
    #13 0x00007fffea5096bb in reply_cb (connection=<optimized out>, res=<optimized out>, user_data=0x5555558b5c80) at gdbusproxy.c:2596
    #14 0x00007fffea4ca834 in g_task_return_now (task=0x5555558b5d50 [GTask]) at gtask.c:1148
    #15 0x00007fffea4cb196 in g_task_return (task=0x5555558b5d50 [GTask], type=<optimized out>) at gtask.c:1206
    #16 0x00007fffea4fdd4a in g_dbus_connection_call_done (source=<optimized out>, result=0x5555558b5e20, user_data=0x5555558b5d50) at gdbusconnection.c:5715
    #17 0x00007fffea4ca834 in g_task_return_now (task=0x5555558b5e20 [GTask]) at gtask.c:1148
    #18 0x00007fffea4ca86d in complete_in_idle_cb (task=task@entry=0x5555558b5e20) at gtask.c:1162
    #19 0x00007fffea73e97b in g_idle_dispatch (source=0x7fffdc04eb90, callback=0x7fffea4ca860 <complete_in_idle_cb>, user_data=0x5555558b5e20) at gmain.c:5620
    #20 0x00007fffea74206d in g_main_dispatch (context=0x5555557c8410) at gmain.c:3182
    #21 0x00007fffea74206d in g_main_context_dispatch (context=context@entry=0x5555557c8410) at gmain.c:3847
    #22 0x00007fffea742438 in g_main_context_iterate (context=0x5555557c8410, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3920
    #23 0x00007fffea742762 in g_main_loop_run (loop=0x55555584ed00) at gmain.c:4116

Fixes: c3efedf54b
(cherry picked from commit 25a3825b51)
2019-02-19 09:34:38 +01:00
Thomas Haller
8f80f7be94 platform/wireguard: fix parsing WGPEER_A_PERSISTENT_KEEPALIVE_INTERVAL from netlink
Fixes: 0827d4c2e4
(cherry picked from commit fc9d661018)
2019-02-18 17:09:52 +01:00
Beniamino Galvani
0381c0a928 ovs: merge branch 'bg/ovs-leaks'
https://github.com/NetworkManager/NetworkManager/pull/296
(cherry picked from commit 080f5ee76b)
2019-02-17 20:45:29 +01:00