1. 18 Jan, 2018 1 commit
  2. 15 Dec, 2017 1 commit
  3. 31 Oct, 2017 1 commit
    • Thomas Haller's avatar
      config: remove nm_config_data_get_value_cached() · 447dc874
      Thomas Haller authored
      It has almost no callers, and it is a bit of a strange API. Let's
      not cache the last accessed value inside NMConfigData. Instead, free
      it right after use. It was not reused anyway, it only hangs around
      as convenience for the caller.
      447dc874
  4. 24 May, 2017 1 commit
  5. 23 Apr, 2017 1 commit
  6. 20 Apr, 2017 2 commits
  7. 18 Apr, 2017 2 commits
    • 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)
      d37b9d79
    • Thomas Haller's avatar
      core: add NMNetns to bundle platform and route managers · 0af2f5c2
      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.
      0af2f5c2
  8. 28 Mar, 2017 1 commit
    • Lubomir Rintel's avatar
      core: make connectivity checking per-device · 9d43869e
      Lubomir Rintel authored
      This moves tracking of connectivity to NMDevice and makes the NMManager
      negotiate the best of known connectivity states of devices. The NMConnectivity
      singleton handles its own configuration and scheduling of the permission
      checks, but otherwise greatly simplifies it.
      
      This will be useful to determine correct metrics for multiple default routes
      depending on actual internet connectivity.
      
      The per-device connection checks is not yet exposed on the D-Bus, since they
      probably should be per-address-family as well.
      9d43869e
  9. 24 Mar, 2017 1 commit
  10. 15 Mar, 2017 1 commit
  11. 17 Feb, 2017 1 commit
    • Thomas Haller's avatar
      core: use define for atomic-section-prefix setting for NMConfig · 9e5319db
      Thomas Haller authored
      main() should pass the same atomic-section-prefix setting to it's
      NMConfig instances. Currently both are NULL, but make it a define
      to make this explicit.
      
      Also, make static array @default_values const and sanitize value
      when setting PROP_ATOMIC_SECTION_PREFIXES property.
      9e5319db
  12. 10 Feb, 2017 1 commit
    • Thomas Haller's avatar
      dns: fix shutdown to restore non-cached DNS config · ecd3263e
      Thomas Haller authored
      The DNS manager and other singletons have the problem that
      they are not properly destroyed on exit, that is, we leak
      most of the instances. That should be eventually fixed and
      all resources/memory should be released.
      
      Anyway, fix the shutdown procedure by adding an explict command
      nm_dns_manager_shutdown(). We should not rely on cleanup actions
      to take place when the last reference is dropped, because then
      we get complex interactions where we must ensure that everybody
      drops the references at the right pointer.
      
      Since the previous shutdown action was effectively never performed,
      it is not quite clear what we actually want to do on shutdown.
      For now, move the code to nm_dns_manager_stop(). We will see if
      that is the desired behavior.
      ecd3263e
  13. 25 Nov, 2016 3 commits
  14. 21 Nov, 2016 2 commits
    • Thomas Haller's avatar
      build: don't add subdirectories to include search path but require qualified include · 44ecb415
      Thomas Haller authored
      Keep the include paths clean and separate. We use directories to group source
      files together. That makes sense (I guess), but then we should use this
      grouping also when including files. Thus require to #include files with their
      path relative to "src/".
      
      Also, we build various artifacts from the "src/" tree. Instead of having
      individual CFLAGS for each artifact in Makefile.am, the CFLAGS should be
      unified. Previously, the CFLAGS for each artifact differ and are inconsistent
      in which paths they add to the search path. Fix the inconsistency by just
      don't add the paths at all.
      44ecb415
    • Thomas Haller's avatar
      build: rename "src/dhcp-manager" to "src/dhcp" · e0539968
      Thomas Haller authored
      The dhcp directory does not only contain the manager
      instance, but various files related to DHCP.
      
      Rename.
      e0539968
  15. 27 Sep, 2016 1 commit
    • Thomas Haller's avatar
      build: don't add systemd path the include search path · e3a072f3
      Thomas Haller authored
      Our internal copy of systemd should not be in the search path.
      Instead, let users only
        #include "systemd/nm-sd.h"
      which then includes everything from systemd that we need.
      
      We want to avoid to accidentally include anything from our
      systemd-copy. Any user of that should only include "nm-sd.h",
      which then includes everything that is needed further.
      
      For example, "src/devices/wwan/nm-modem-manager.c" has
        #include <systemd/nm-daemon.h>
      which in turn includes
        #include "_sd-common.h"
      This works all correctly before, because #include "" will first
      look in the directory where sd-daemon.h is. However, our mixing of
      external systemd library and internal copy is rather dangerous.
      Try to avoid it further by keeping the include paths clean.
      e3a072f3
  16. 26 Sep, 2016 1 commit
    • Thomas Haller's avatar
      config: store and load device runtime state to file · 93396b8d
      Thomas Haller authored
      The data is still unused, the actual fields might change.
      
      Note that the actual state we store is subject to change,
      according to which data we need. The file format is non stable,
      as the files don't survive reboot. So there is no backward
      compatibility to maintain and the format can be changed later.
      93396b8d
  17. 01 Jun, 2016 1 commit
    • Thomas Haller's avatar
      config: refactor change-flags to be a cause/reason which triggered the change · eb6140a7
      Thomas Haller authored
      For the most part, this patch just renames some change-flags, but
      doesn't change much about them. The new name should better express
      what they are.
      
      A config-change signal can be emitted for different reasons:
      when we receive a signal (SIGHUP, SIGUSR1, SIGUSR2) or for internal
      reasons like resetting of no-auto-default or setting internal
      values.
      
      Depending on the reason, we want to perform different actions.
      For example:
       - we reload the configuration from disk on SIGHUP, but not for
         SIGUSR1.
       - For SIGUSR1 and SIGHUP, we want to update-dns, but not for SIGUSR2.
      
      Another part of the change-flags encodes which part of the configuration
      actually changed. Often, these parts can only change when re-reading
      from disk (e.g. a SIGUSR1 will not change any configuration inside
      NMConfig).
      
      Later, we will have more causes, and accordingly more fine-grained
      effects of what should be done on reload.
      eb6140a7
  18. 30 Apr, 2016 1 commit
    • Thomas Haller's avatar
      build: cleanup includes of <gmodule.h> · c5ac6917
      Thomas Haller authored
      <gmodule.h> is implicitly included by <gio/gio.h> which is available
      everywhere. For that reason, we would not have to include this header
      at all. However, it is recommended to explicitly include <gmodule.h>
      where needed.
      
      So, include it where needed -- if <gio/gio.h> wouldn't be there --
      and drop it from where it is not needed.
      c5ac6917
  19. 07 Apr, 2016 2 commits
  20. 21 Mar, 2016 2 commits
  21. 11 Mar, 2016 2 commits
    • Thomas Haller's avatar
      systemd: split "nm-sd.h" out of "nm-sd-adapt.h" · aed3c810
      Thomas Haller authored
      Now we have:
      
      "nm-sd.h" is a header file of NetworkManager with utilities
      related to systemd. It can be used anywhere freely.
      
      Also, systemd headers that are considered public API (like
      "sd-event.h") can be used without restrictions.
      
      When compiling the systemd sources, we always must include
      "nm-sd-adapt.h" as first. Similarly, systemd headers must
      not include "nm-sd-adapt.h", because they are either public
      (in which case the adapter is not needed) or they are internal
      (in which case they are themself included via a systemd source).
      
      Sometimes, we must internal API (like "dhcp-lease-internal.h").
      In this case, we also must include "nm-sd-adapt.h".
      aed3c810
    • Thomas Haller's avatar
      systemd: integrate sd-event into glib main loop · a8bc65b1
      Thomas Haller authored
      We should not try to reimplement sd-event based on glib,
      instead we should hook sd-event into the glib mainloop.
      a8bc65b1
  22. 03 Mar, 2016 2 commits
    • Thomas Haller's avatar
      all: don't include error->code in log messages · cd4f84b7
      Thomas Haller authored
      GError codes are only unique per domain, so logging the code without
      also indicating the domain is not helpful. And anyway, if the error
      messages are not distinctive enough to tell the whole story then we
      should fix the error messages.
      Based-on-patch-by: Dan Winship's avatarDan Winship <danw@gnome.org>
      cd4f84b7
    • Thomas Haller's avatar
      all: clean-up usage of GError · 01b9b410
      Thomas Haller authored
      Functions that take a GError** MUST fill it in on error. There is no
      need to check whether error is NULL if the function it was passed to
      had a failing return value.
      
      Likewise, a proper GError must have a non-NULL message, so there's no
      need to double-check that either.
      Based-on-patch-by: Dan Winship's avatarDan Winship <danw@gnome.org>
      01b9b410
  23. 21 Feb, 2016 1 commit
  24. 19 Feb, 2016 1 commit
    • Thomas Haller's avatar
      all: cleanup includes and let "nm-default.h" include "config.h" · 8bace23b
      Thomas Haller authored
      - All internal source files (except "examples", which are not internal)
        should include "config.h" first. As also all internal source
        files should include "nm-default.h", let "config.h" be included
        by "nm-default.h" and include "nm-default.h" as first in every
        source file.
        We already wanted to include "nm-default.h" before other headers
        because it might contains some fixes (like "nm-glib.h" compatibility)
        that is required first.
      
      - After including "nm-default.h", we optinally allow for including the
        corresponding header file for the source file at hand. The idea
        is to ensure that each header file is self contained.
      
      - Don't include "config.h" or "nm-default.h" in any header file
        (except "nm-sd-adapt.h"). Public headers anyway must not include
        these headers, and internal headers are never included after
        "nm-default.h", as of the first previous point.
      
      - Include all internal headers with quotes instead of angle brackets.
        In practice it doesn't matter, because in our public headers we must
        include other headers with angle brackets. As we use our public
        headers also to compile our interal source files, effectively the
        result must be the same. Still do it for consistency.
      
      - Except for <config.h> itself. Include it with angle brackets as suggested by
        https://www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Headers
      8bace23b
  25. 22 Nov, 2015 1 commit
  26. 13 Nov, 2015 1 commit
    • Beniamino Galvani's avatar
      core: fix failed assertion when D-Bus service is already taken · f1b4eb95
      Beniamino Galvani authored
      When exiting after an error we must set the quitting flag in
      nm-exported-object.c because during program destruction there can be
      still exported objects which get disposed.
      
      Fixes the following assertion:
      
       NetworkManager[14241]: (nm-exported-object.c:826):nm_exported_object_dispose: code should not be reached
      
       Process terminating with default action of signal 5 (SIGTRAP)
          at 0x7ACFD3B: _g_log_abort (gmessages.c:315)
          by 0x7ACFD3B: g_logv (gmessages.c:1041)
          by 0x7ACFEAE: g_log (gmessages.c:1079)
          by 0x7AD0196: g_warn_message (gmessages.c:1112)
          by 0x20F5B0:  nm_exported_object_dispose (nm-exported-object.c:826)
          by 0x316FC4:  dispose (nm-settings.c:2222)
          by 0x7841A5B: g_object_unref (gobject.c:3137)
          by 0x2330F3:  dispose (nm-manager.c:5249)
          by 0x7841A5B: g_object_unref (gobject.c:3137)
          by 0x23C511:  _nm_singleton_instance_destroy (NetworkManagerUtils.c:174)
          by 0x400FBE6: _dl_fini (in /usr/lib64/ld-2.21.so)
          by 0x8009647: __run_exit_handlers (in /usr/lib64/libc-2.21.so)
          by 0x8009694: exit (in /usr/lib64/libc-2.21.so)
      f1b4eb95
  27. 10 Nov, 2015 1 commit
    • Dan Williams's avatar
      core: explicitly unexport objects when we're done with them · f9ee20a7
      Dan Williams authored
      Previously most objects were implicitly unexported when they were
      destroyed, but since refcounts may make the object live longer than
      intended, we should explicitly unexport them when they should no
      longer be present on the bus.
      
      This means we can assume that objects will always be un-exported
      already when they are destroyed, *except* when quitting where most
      objects will live until exit because NM leaves interfaces up and
      running on quit.
      f9ee20a7
  28. 15 Sep, 2015 2 commits
  29. 13 Aug, 2015 2 commits