1. 15 Jan, 2020 5 commits
  2. 01 Aug, 2019 4 commits
  3. 23 Jul, 2019 1 commit
  4. 22 Jul, 2019 1 commit
  5. 18 Jul, 2019 1 commit
    • Thomas Haller's avatar
      device: fix reapplying changes to connection ID and UUID · cacb80e5
      Thomas Haller authored
      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
      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: bf3b3d44 ('device: avoid changing immutable properties during reapply')
      (cherry picked from commit adb51c2a)
      (cherry picked from commit 09f37d5b)
      (cherry picked from commit 9c72ca5e)
      (cherry picked from commit b1209e37)
  6. 09 Jul, 2019 1 commit
  7. 19 May, 2019 1 commit
  8. 14 May, 2019 1 commit
    • Thomas Haller's avatar
      core: fix file permissions for "/var/lib/NetworkManager/secret_key" · 2146307e
      Thomas Haller authored
      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: dbcb1d6d ('core: let nm_utils_secret_key_read() handle failures internally')
      (cherry picked from commit dc3a2f9b)
      (cherry picked from commit 2d46247c)
      (cherry picked from commit 7a0f8520)
      (cherry picked from commit 869ac551)
  9. 10 May, 2019 2 commits
    • Thomas Haller's avatar
      settings/d-bus: fix boolean return value of "LoadConnections" · add6f1c2
      Thomas Haller authored
      The boolean value is intended to indicate success. It would indicated
      failure due to a bug.
      Fixes: 297d4985 ('core/dbus: rework D-Bus implementation to use lower layer GDBusConnection API'):
      (cherry picked from commit 22e830f0)
      (cherry picked from commit e73a5058)
      (cherry picked from commit 1337ebd9)
      (cherry picked from commit 703864e2)
    • Thomas Haller's avatar
      settings: avoid assertion for LoadConnections D-Bus method with relative paths · 7a019089
      Thomas Haller authored
        $ 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 a1b102ea)
      (cherry picked from commit c21171e0)
      (cherry picked from commit 8fe900d3)
      (cherry picked from commit 6052b863)
  10. 18 Apr, 2019 1 commit
  11. 15 Mar, 2019 1 commit
  12. 11 Mar, 2019 1 commit
    • Thomas Haller's avatar
      shared/systemd: fix gettid() compat implementation shadowing function from glibc · b10a7e57
      Thomas Haller authored
      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 10276322)
      (cherry picked from commit cfb970b2)
      (cherry picked from commit d160b7b9)
  13. 07 Mar, 2019 1 commit
  14. 05 Mar, 2019 1 commit
  15. 04 Mar, 2019 1 commit
  16. 19 Feb, 2019 9 commits
    • Beniamino Galvani's avatar
    • Beniamino Galvani's avatar
      device: don't remove routes when the interface is down · 4fc6f5f3
      Beniamino Galvani authored
      In update update_ext_ip_config() we remove from various internal
      configurations those addresses and routes that were removed externally
      by users.
      When the interface is brought down, the kernel automatically removes
      routes associated with it and so we should not consider them as
      "removed by users".
      Instead, keep them so that they can be restored when the interface
      comes up again.
      (cherry picked from commit f069c98c)
      (cherry picked from commit ce2d4035)
    • Beniamino Galvani's avatar
      ip-config: add @intersect_routes argument to intersect functions · da46fcaf
      Beniamino Galvani authored
      In some cases we want to intersect two IP configurations without
      considering routes.
      (cherry picked from commit 8f07b3ac)
      (cherry picked from commit bd79e67c)
    • Beniamino Galvani's avatar
      device: fix updating device information after link change · 4775b1df
      Beniamino Galvani authored
      device_link_changed() can't use nm_device_update_from_platform_link()
      to update the device private fields because the latter overwrites
      priv->iface and priv->up, and so the checks below as:
        if (info.name[0] && strcmp (priv->iface, info.name) != 0) {
        was_up = priv->up;
        priv->up = NM_FLAGS_HAS (info.n_ifi_flags, IFF_UP);
        if (priv->up && !was_up) {
      never succeed.
      Fixes: d7f7725a
      (cherry picked from commit 46ed7561)
      (cherry picked from commit 81aaf0ff)
    • Beniamino Galvani's avatar
      core: improve nm_ip_config_dump() · 33aae9b8
      Beniamino Galvani authored
      Previously we had nm_ip{4,6}_config_dump() for debugging purposes, but
      they were inconveniently printing to stdout and so the output was not
      ordered in the journal.
      Implement a unified nm_ip_config_dump() that logs through the usual
      logging mechanism.
      (cherry picked from commit 3b49d107)
      (cherry picked from commit 0b1ffdbd)
    • Beniamino Galvani's avatar
      device: ensure IP configuration is restored when link goes up · c941b6fa
      Beniamino Galvani authored
      When the link is up and goes down link_changed_cb() schedules
      device_link_changed() to be run later. If the function is dispatched
      when the link is already up again, it does not detect that the link
      was down.
      Fix this by storing in the device state that we saw the link down so
      that device_link_changed() can properly restore the IP configuration.
      (cherry picked from commit 7bd193ef)
      (cherry picked from commit 710406e7)
    • Thomas Haller's avatar
      libnm: fix leaking checkpoints from NMManager · 4a49df33
      Thomas Haller authored
      Fixes: c3efedf5
      (cherry picked from commit 10600bdb)
      (cherry picked from commit 4c694e46)
    • Thomas Haller's avatar
      libnm: fix memleak for NMDeviceTun:hw-address · be2da47a
      Thomas Haller authored
      Fixes: 337304f1
      (cherry picked from commit 41ea9fff)
      (cherry picked from commit 38890376)
    • Thomas Haller's avatar
      libnm: fix duplicate free in nm_client_checkpoint_rollback() · 3fb254fc
      Thomas Haller authored
          #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: c3efedf5
      (cherry picked from commit 25a3825b)
      (cherry picked from commit a505ab42)
  17. 05 Feb, 2019 1 commit
    • Lubomir Rintel's avatar
      platform/linux: fix setting of IFA_ADDRESS without a peer · 58f7b55b
      Lubomir Rintel authored
      Since commit 9ecdba31 ('platform: create netlink messages directly
      without libnl-route-3') we're unconditionally setting IFA_ADDRESS to
      the peer address, even if there's no peer and it's all zeroes.
      The kernel actually stopped caring somewhere around commit caeaba790
      ('ipv6: add support of peer address') in v3.10, but Ubuntu Touch likes
      to run Android's v3.4 on some poorly supported hardware.
      Fixes: 9ecdba31
      (cherry picked from commit ef6d461b)
      (cherry picked from commit e2409b18)
  18. 04 Feb, 2019 1 commit
    • Beniamino Galvani's avatar
      vpn: add route to vpn gw when parent has a default device route · ef6ad048
      Beniamino Galvani authored
      When the parent device has a device default route (i.e. without
      gateway) and we establish a VPN on top of it, 'ip route get' for the
      VPN gateway returns a device route, which is the same result we get
      for an unreachable VPN gateway. However it is necessary to add the
      route to the gateway or otherwise it will possibly become unreachable
      once the VPN gets activated.
      (cherry picked from commit 797eab2f)
      (cherry picked from commit 6808cd48)
  19. 31 Jan, 2019 1 commit
  20. 17 Jan, 2019 1 commit
  21. 16 Jan, 2019 1 commit
  22. 14 Jan, 2019 2 commits
  23. 02 Jan, 2019 1 commit