1. 19 Apr, 2017 8 commits
  2. 18 Apr, 2017 12 commits
    • Beniamino Galvani's avatar
      platform: detect SR-IOV support and allow changing the number of VFs · 2511e27e
      Beniamino Galvani authored
      (cherry picked from commit 0a7694cf)
    • Thomas Haller's avatar
      device: leave device up when setting it as unmanaged by user · 785b51ed
      Thomas Haller authored
      Before, setting a device to unmanaged causes it to go down and clear
      the interface state.
      It may be useful to instruct NetworkManager not to touch the device
      anymore but leave the current state up. Changing behavior for
        nmcli device set "$DEV" managed no
      To get the previous behavior, one has to first disconnect the interface
        nmcli device disconnect "$DEV"
        nmcli device set "$DEV" managed no
      Note that non-permanent addresses like from DHCP will eventually time
      out because NetworkManager stops the DHCP client. When instructing
      NetworkManager to let go of the device, you have to take it over in
      any way you see fit.
      (cherry picked from commit 9e8218f9)
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      core: enable "log-with-ptr" by default for platform and route-manager · c2297fb6
      Thomas Haller authored
      Arguably, we currently only have one instance of NMPlatform,
      NMRouteManager, NMDefaultRouteManager -- the one owned by the
      NMNetns singleton.
      Hence, all these instances we create with "log-with-ptr" set explicitly
      to false.
      In the future we want to support namespaces, and it will be be common to
      have multiple instances. For that we have "log-with-ptr" so we are able
      to disambiguiate the logging.
      Change the default to TRUE because it makes more sense. It has currently
      no effect as the default is never used.
      (cherry picked from commit 41148cab)
    • Thomas Haller's avatar
      device: don't use platform singleton getter in device subclasses · 7b91e8b6
      Thomas Haller authored
      Reduce the use of NM_PLATFORM_GET / nm_platform_get() to get
      the platform singleton instance.
      For one, this is a step towards supporting namespaces, where we need
      to use different NMNetns/NMPlatform instances depending on in which
      namespace the device lives.
      Also, we should reduce our use of singletons. They are difficult to
      coordinate on shutdown. Instead there should be a clear order of
      dependencies, expressed by owning a reference to those singelton
      instances. We already own a reference to the platform singelton,
      so use it and avoid NM_PLATFORM_GET.
      (cherry picked from commit 94d9ee12)
    • Thomas Haller's avatar
      device: keep NMNetns instance per device · 8a6eef6a
      Thomas Haller authored
      This also ensures that we own a reference to the
      NMPlatform, NMRouteManager and NMDefaultRouteManager
      instances. See bug rh#1440089 where we might access
      the singleton getter after destroing the singleton
      instance of NMRouteManager. This is prevented by
      keeping a reference to those instances -- indirectly
      via the netns instance.
      Later, we may add support for multiple namespaces. Then it might
      make sense to swap the NMNetns instance of a device when moving
      the device between namespaces.
      Also, drop the use of singelton instances.
      (cherry picked from commit c48a19b7)
    • Thomas Haller's avatar
      core: add NMNetns to bundle platform and route managers · d37b9d79
      Thomas Haller authored
      NMPlatform, NMRouteManager and NMDefaultRouteManager are singletons
      instances. Users of those are for example NMDevice, which registers
      to GObject signals of both NMPlatform and NMRouteManager.
      Hence, as NMDevice:dispose() disconnects the signal handlers, it must
      ensure that those singleton instances live longer then the NMDevice
      instance. That is usually accomplished by having users of singleton
      instances own a reference to those instances.
      For NMDevice that effectively means that it shall own a reference to
      several singletons.
      NMPlatform, NMRouteManager, and NMDefaultRouteManager are all
      per-namespace. In general it doesn't make sense to have more then
      one instances of these per name space. Nnote that currently we don't
      support multiple namespaces yet. If we will ever support multiple
      namespaces, then a NMDevice would have a reference to all of these
      manager instances. Hence, introduce a new class NMNetns which bundles
      them together.
      (cherry picked from commit 0af2f5c2)
    • Beniamino Galvani's avatar
      manager: set interface as removed when the link disappears · a39fac22
      Beniamino Galvani authored
      Set the device state as removed when the link disappears, so that in
      the call to unrealize() when the device is unmanaged we also perform a
      cleanup of it and especially, we terminate any DHCP client instances
      running on the device.
      If we keep DHCP clients running, we can hit assertions later when we
      start another instance on the same interface, because we kill the old
      dhclient from the pidfile, and the g_child_watch_add() done by the
      first client instance is not able to waitpid() it, complaining with:
        GChildWatchSource: Exit status of a child process was requested but
        ECHILD was received by waitpid(). Most likely the process is
        ignoring SIGCHLD, or some other thread is invoking waitpid() with a
        nonpositive first argument; either behavior can break applications
        that use g_child_watch_add()/g_spawn_sync() either directly or
      (cherry picked from commit df537d2e)
    • Thomas Haller's avatar
      test: fix undefined behavior shifting signed integer in test · 297ad945
      Thomas Haller authored
      (cherry picked from commit d58d8d75)
    • Lubomir Rintel's avatar
      m4: disable -Wmissing-braces for newer clang · 928d68d0
      Lubomir Rintel authored
        src/NetworkManagerUtils.c:347:18: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces]
                NMIPAddr a1 = { 0 }, a2 = { 0 };
      Should we initialize unions this way? I think it's all right -- the initializer
      works well and { { { 0 } } } is probably not what we'd like to see.
      (cherry picked from commit 43012156)
    • Lubomir Rintel's avatar
      platform: fix a typo · fcad4fba
      Lubomir Rintel authored
      (cherry picked from commit c76ee588)
    • Dan Williams's avatar
      ppp: allow disabling IPv4 too · 589fc017
      Dan Williams authored
      (cherry picked from commit a12b3f06)
  3. 14 Apr, 2017 9 commits
  4. 13 Apr, 2017 3 commits
  5. 11 Apr, 2017 8 commits
    • Beniamino Galvani's avatar
      manager: unexport VPN connections when the activation fails early · ed699114
      Beniamino Galvani authored
      When a VPN connection can't be activated we have to unexport and
      dispose it. Commit f2182fbf ("core: don't emit double
      PropertiesChanged signal for new active connections") removed the call
      to nm_exported_object_unexport() in case of failure because the active
      connection already gets unreferenced on failure.
      However, an exported object can't be disposed until it's explicitly
      unexported because GDBus code keeps a reference to it. The result was
      that the active connection was kept alive and exported, but without
      explicit references to it. As soon as the connection was unexported,
      it was also automatically disposed, causing issues like:
       (src/nm-exported-object.c:1025):dispose: code should not be reached
       #0   _g_log_abort () at /lib64/libglib-2.0.so.0
       #1   g_logv () at /lib64/libglib-2.0.so.0
       #2   g_log () at /lib64/libglib-2.0.so.0
       #3   g_warn_message () at /lib64/libglib-2.0.so.0
       #4   dispose (object=0xaaf110) at src/nm-exported-object.c:1025
       #5   dispose (object=0xaaf110) at src/nm-active-connection.c:1246
       #6   dispose (object=0xaaf110) at src/vpn/nm-vpn-connection.c:2642
       #7   g_object_unref () at /lib64/libgobject-2.0.so.0
       #8   registration_data_free () at /lib64/libgio-2.0.so.0
       #9   g_hash_table_remove_internal () at /lib64/libglib-2.0.so.0
       #10  g_dbus_object_manager_server_unexport_unlocked () at /lib64/libgio-2.0.so.0
       #11  g_dbus_object_manager_server_unexport () at /lib64/libgio-2.0.so.0
       #12  nm_bus_manager_unregister_object (self=0x9069e0, object=object@entry=0xaaf110) at src/nm-bus-manager.c:858
       #13  nm_exported_object_unexport (self=0xaaf110) at src/nm-exported-object.c:714
       #14  _settings_connection_removed (connection=<optimized out>, user_data=0xaaf110) at src/nm-active-connection.c:184
       #15  g_closure_invoke () at /lib64/libgobject-2.0.so.0
       #16  signal_emit_unlocked_R () at /lib64/libgobject-2.0.so.0
       #17  g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
       #18  g_signal_emit_by_name () at /lib64/libgobject-2.0.so.0
       #19  nm_settings_connection_signal_remove (self=self@entry=0x9e4a80, allow_reuse=allow_reuse@entry=0) at src/settings/nm-settings-connection.c:2085
       #20  do_delete (self=0x9e4a80, callback=0x58106a <con_delete_cb>, user_data=0xa84fa0) at src/settings/nm-settings-connection.c:768
       #21  do_delete (connection=0x9e4a80, callback=0x58106a <con_delete_cb>, user_data=0xa84fa0) at src/settings/plugins/keyfile/nms-keyfile-connection.c:127
       #22  nm_settings_connection_delete (self=self@entry=0x9e4a80, callback=callback@entry=0x58106a <con_delete_cb>, user_data=0xa84fa0) at src/settings/nm-settings-connection.c:694
       #23  delete_auth_cb (self=self@entry=0x9e4a80, context=context@entry=0x7fffd80131e0, subject=0x91fb40, error=<optimized out>, data=data@entry=0x0) at src/settings/nm-settings-connection.c:1879
       #24  pk_auth_cb (chain=0x7fffd00024a0, chain_error=<optimized out>, context=0x7fffd80131e0, user_data=<optimized out>) at src/settings/nm-settings-connection.c:1351
       #25  auth_chain_finish (user_data=0x7fffd00024a0) at src/nm-auth-utils.c:92
       #26  g_idle_dispatch () at /lib64/libglib-2.0.so.0
      Restore the unexport upon failure to fix this.
      Fixes: f2182fbf
      (cherry picked from commit 69fd9611)
    • Lubomir Rintel's avatar
      wifi: only attempt to set the scan MAC address when it actually changes · 345bc90b
      Lubomir Rintel authored
      The address change involves setting the link down which causes the supplicant
      interface to change state and in turn another scan attempt. This could lead to
      a loop in case of broken drivers that are not able to change the MAC address
      iff the MAC address is attempted at each scan request.
      (cherry picked from commit 02341729)
    • Francesco Giudici's avatar
      nmcli: fix "nmcli device monitor <dev>" · d9ca557c
      Francesco Giudici authored
      Call get_device_list() after next_arg(); call it only after checking
      that there are other arguments after "monitor".
      Fixes: 6a3d77fb
      (cherry picked from commit 2c4e991a)
    • Beniamino Galvani's avatar
    • Beniamino Galvani's avatar
      pacrunner: remove failed and pending items from configuration list · c6f2173f
      Beniamino Galvani authored
      If a configuration does not have a path it is because we are still
      sending it to pacrunner or because we failed to do so. In both cases,
      we have to remove the configuration from the list.
      Fixes: 3ad89223
      (cherry picked from commit fad2cf07)
    • Beniamino Galvani's avatar
      device: fix removal of pacrunner configurations · 0dead638
      Beniamino Galvani authored
      Don't try to remove the configuration if we haven't added it in the
      first place, for example when the connection gets deactivated before
      it completes or for slave connections without IP configuration.
      Fixes: 3ad89223
      (cherry picked from commit 3cada772)
    • Beniamino Galvani's avatar
      pacrunner: specify domains only for VPNs · 1fe0b781
      Beniamino Galvani authored
      If a VPN provides a proxy, we want to restrict the usage of that proxy
      to URLs in the VPN domain. For all other connections, the proxy should
      be used for all domains.
      (cherry picked from commit b1395522)
    • Beniamino Galvani's avatar
      pacrunner: don't log pacrunner-manager address · e4b32310
      Beniamino Galvani authored
      It's a singleton, the address is not meaningful.
      (cherry picked from commit 752e906a)