1. 14 Aug, 2015 6 commits
  2. 13 Aug, 2015 26 commits
  3. 12 Aug, 2015 8 commits
    • Lubomir Rintel's avatar
      device-factory: allow using nm_device_factory_manager_for_each_factory() before load · b339d4e5
      Lubomir Rintel authored
      We can dispose the manager before loading the factories:
      
        NetworkManager[20214]: <error> [1439391976.738579] [nm-bus-manager.c:764] nm_bus_manager_start_service(): Could not acquire the NetworkManager service as it is already taken.
        NetworkManager[20214]: <error> [1439391976.738617] [main.c:424] main(): failed to start the dbus service.
        NetworkManager[20214]: nm_device_factory_manager_for_each_factory: assertion 'factories_by_link' failed
      
        Program received signal SIGTRAP, Trace/breakpoint trap.
        g_logv (log_domain=0x5a5028 "NetworkManager", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffd750) at gmessages.c:1046
        1046              g_private_set (&g_log_depth, GUINT_TO_POINTER (depth));
        (gdb) bt
        #0  0x00007ffff4a738c3 in g_logv (log_domain=0x5a5028 "NetworkManager", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffd750) at gmessages.c:1046
        #1  0x00007ffff4a73a3f in g_log (log_domain=log_domain@entry=0x5a5028 "NetworkManager", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7ffff4ae173d "%s: assertion '%s' failed")
            at gmessages.c:1079
        #2  0x00007ffff4a73a79 in g_return_if_fail_warning (log_domain=log_domain@entry=0x5a5028 "NetworkManager", pretty_function=pretty_function@entry=0x5a5420 <__FUNCTION__.26921> "nm_device_factory_manager_for_each_factory", expression=expression@entry=0x5a4f25 "factories_by_link") at gmessages.c:1088
        #3  0x00000000004704e4 in nm_device_factory_manager_for_each_factory (callback=callback@entry=0x4d29a0 <_deinit_device_factory>, user_data=user_data@entry=0x8802b0) at devices/nm-device-factory.c:306
        #4  0x00000000004d2927 in dispose (object=0x8802b0 [NMManager]) at nm-manager.c:5086
        #5  0x00007ffff4d6ea82 in g_object_unref (_object=0x8802b0) at gobject.c:3133
        #6  0x00000000004459f6 in main (argc=1, argv=0x7fffffffda88) at main.c:468
        (gdb)
      b339d4e5
    • Lubomir Rintel's avatar
      device: avoid a crash during destruction · 688e93fb
      Lubomir Rintel authored
      The ipv4_config might be gone already, _cleanup_generic_post() sets it to NULL.
      
        NetworkManager[30564]: <info>  caught SIGINT, shutting down normally.
      
        (NetworkManager:30564): GLib-GObject-CRITICAL **: g_type_instance_get_private: assertion 'instance != NULL && instance->g_class != NULL' failed
      
        Program received signal SIGTRAP, Trace/breakpoint trap.
        g_logv (log_domain=0x7ffff4d92f64 "GLib-GObject", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffd5e0) at gmessages.c:1046
        1046              g_private_set (&g_log_depth, GUINT_TO_POINTER (depth));
        (gdb) bt
        #0  0x00007ffff4a738c3 in g_logv (log_domain=0x7ffff4d92f64 "GLib-GObject", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fffffffd5e0) at gmessages.c:1046
        #1  0x00007ffff4a73a3f in g_log (log_domain=log_domain@entry=0x7ffff4d92f64 "GLib-GObject", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x7ffff4ae173d "%s: assertion '%s' failed")
            at gmessages.c:1079
        #2  0x00007ffff4a73a79 in g_return_if_fail_warning (log_domain=log_domain@entry=0x7ffff4d92f64 "GLib-GObject", pretty_function=pretty_function@entry=0x7ffff4d9aad0 <__FUNCTION__.13620> "g_type_instance_get_private", expression=expression@entry=0x7ffff4d99db8 "instance != NULL && instance->g_class != NULL") at gmessages.c:1088
        #3  0x00007ffff4d8d2ba in g_type_instance_get_private (instance=instance@entry=0x0, private_type=<optimized out>) at gtype.c:4632
        #4  0x00000000004bf774 in nm_ip4_config_get_num_addresses (config=0x0) at nm-ip4-config.c:1418
        #5  0x0000000000458834 in _update_ip4_address (self=self@entry=0xa8a490 [NMDeviceBridge]) at devices/nm-device.c:6069
        #6  0x000000000045e740 in nm_device_set_ip4_config (self=self@entry=0xa8a490 [NMDeviceBridge], new_config=new_config@entry=0x0, default_route_metric=default_route_metric@entry=0, commit=commit@entry=1, routes_full_sync=routes_full_sync@entry=1, reason=reason@entry=0x7fffffffd7cc) at devices/nm-device.c:6558
        #7  0x0000000000466c56 in _cleanup_generic_post (self=self@entry=0xa8a490 [NMDeviceBridge], cleanup_type=cleanup_type@entry=CLEANUP_TYPE_KEEP) at devices/nm-device.c:8108
        #8  0x00000000004671af in dispose (object=0xa8a490 [NMDeviceBridge]) at devices/nm-device.c:9128
        #9  0x00007ffff4d6ea82 in g_object_unref (_object=0xa8a490) at gobject.c:3133
        #10 0x00000000004d1a53 in remove_device (manager=manager@entry=0x8822b0 [NMManager], device=0xa8a490 [NMDeviceBridge], quitting=quitting@entry=1, allow_unmanage=allow_unmanage@entry=1) at nm-manager.c:780
        #11 0x00000000004d7db1 in nm_manager_stop (self=self@entry=0x8822b0 [NMManager]) at nm-manager.c:4199
        #12 0x0000000000445aa9 in main (argc=1, argv=0x7fffffffda88) at main.c:465
        (gdb)
      688e93fb
    • Thomas Haller's avatar
      macros: use short-circuit evaluation in NM_IN_SET() · 96cacc07
      Thomas Haller authored
      All current users of NM_IN_SET() would rather use short-circuit evalation
      (or don't care). It seems that doing it by default seems favorable.
      
      The only downside is, that this might have somewhat unexpected behavior
      to a user who expects a regular function (which would evaluate always
      all arguments).
      
      Fixes: 7860ef95
      96cacc07
    • Thomas Haller's avatar
      macros: rework NM_IN_SET() macro to expand to a plain logical expression · 7860ef95
      Thomas Haller authored
      Let the preprocessor do more work, but generate a simple expression that
      the compiler can optimize (presumably) better.
      7860ef95
    • Thomas Haller's avatar
      edb0cc23
    • Thomas Haller's avatar
      systemd: update code from upstream · 8f4e6175
      Thomas Haller authored
      This is a direct dump from systemd git on 2015-08-12, git commit
      3f1818cf70ac34c.
      
      ======
      
      SYSTEMD_DIR=../systemd
      COMMIT=3f1818cf70ac34cf93f1f033b4f1bbb7a89b3dff
      
      (
        cd "$SYSTEMD_DIR"
        git checkout "$COMMIT"
        git reset --hard
        git clean -fdx
      )
      
      git ls-files :/src/systemd/src/ | xargs -d '\n' rm -f
      
      nm_copy_sd() {
          mkdir -p "./src/systemd/$(dirname "$1")"
          cp "$SYSTEMD_DIR/$1" "./src/systemd/$1"
      }
      
      nm_copy_sd "src/basic/async.h"
      nm_copy_sd "src/basic/fileio.c"
      nm_copy_sd "src/basic/fileio.h"
      nm_copy_sd "src/basic/hostname-util.c"
      nm_copy_sd "src/basic/hostname-util.h"
      nm_copy_sd "src/basic/in-addr-util.c"
      nm_copy_sd "src/basic/in-addr-util.h"
      nm_copy_sd "src/basic/list.h"
      nm_copy_sd "src/basic/log.h"
      nm_copy_sd "src/basic/macro.h"
      nm_copy_sd "src/basic/path-util.c"
      nm_copy_sd "src/basic/path-util.h"
      nm_copy_sd "src/basic/random-util.c"
      nm_copy_sd "src/basic/random-util.h"
      nm_copy_sd "src/basic/refcnt.h"
      nm_copy_sd "src/basic/siphash24.c"
      nm_copy_sd "src/basic/siphash24.h"
      nm_copy_sd "src/basic/socket-util.h"
      nm_copy_sd "src/basic/sparse-endian.h"
      nm_copy_sd "src/basic/strv.c"
      nm_copy_sd "src/basic/strv.h"
      nm_copy_sd "src/basic/time-util.c"
      nm_copy_sd "src/basic/time-util.h"
      nm_copy_sd "src/basic/unaligned.h"
      nm_copy_sd "src/basic/utf8.c"
      nm_copy_sd "src/basic/utf8.h"
      nm_copy_sd "src/basic/util.c"
      nm_copy_sd "src/basic/util.h"
      nm_copy_sd "src/libsystemd-network/dhcp6-internal.h"
      nm_copy_sd "src/libsystemd-network/dhcp6-lease-internal.h"
      nm_copy_sd "src/libsystemd-network/dhcp6-network.c"
      nm_copy_sd "src/libsystemd-network/dhcp6-option.c"
      nm_copy_sd "src/libsystemd-network/dhcp6-protocol.h"
      nm_copy_sd "src/libsystemd-network/dhcp-identifier.c"
      nm_copy_sd "src/libsystemd-network/dhcp-identifier.h"
      nm_copy_sd "src/libsystemd-network/dhcp-internal.h"
      nm_copy_sd "src/libsystemd-network/dhcp-lease-internal.h"
      nm_copy_sd "src/libsystemd-network/dhcp-network.c"
      nm_copy_sd "src/libsystemd-network/dhcp-option.c"
      nm_copy_sd "src/libsystemd-network/dhcp-packet.c"
      nm_copy_sd "src/libsystemd-network/dhcp-protocol.h"
      nm_copy_sd "src/libsystemd-network/ipv4ll-internal.h"
      nm_copy_sd "src/libsystemd-network/ipv4ll-internal.h"
      nm_copy_sd "src/libsystemd-network/ipv4ll-network.c"
      nm_copy_sd "src/libsystemd-network/ipv4ll-packet.c"
      nm_copy_sd "src/libsystemd-network/network-internal.c"
      nm_copy_sd "src/libsystemd-network/network-internal.h"
      nm_copy_sd "src/libsystemd-network/sd-dhcp6-client.c"
      nm_copy_sd "src/libsystemd-network/sd-dhcp6-lease.c"
      nm_copy_sd "src/libsystemd-network/sd-dhcp-client.c"
      nm_copy_sd "src/libsystemd-network/sd-dhcp-lease.c"
      nm_copy_sd "src/libsystemd-network/sd-ipv4ll.c"
      nm_copy_sd "src/libsystemd/sd-id128/sd-id128.c"
      nm_copy_sd "src/shared/dns-domain.c"
      nm_copy_sd "src/shared/dns-domain.h"
      nm_copy_sd "src/systemd/_sd-common.h"
      nm_copy_sd "src/systemd/sd-dhcp6-client.h"
      nm_copy_sd "src/systemd/sd-dhcp6-lease.h"
      nm_copy_sd "src/systemd/sd-dhcp-client.h"
      nm_copy_sd "src/systemd/sd-dhcp-lease.h"
      nm_copy_sd "src/systemd/sd-event.h"
      nm_copy_sd "src/systemd/sd-id128.h"
      nm_copy_sd "src/systemd/sd-ipv4ll.h"
      8f4e6175
    • Thomas Haller's avatar
      config/tests: fix tests after introducing NMExportedObject class · 3ae6f9d7
      Thomas Haller authored
      The config-tests contain a NMTestDevice which derives from NMDevice.
      However, for testing, it just skips the constructor and destructor of
      NMDevice. This caused also the destructors of NMExportedObject to be skipped
      and thus valgrind complained about leaked memory.
      
      Fixes: 6fcc1dee
      3ae6f9d7
    • Thomas Haller's avatar
      dhcp/tests: fix memleaks in dhcp-tests · 286455bf
      Thomas Haller authored
      These are old leaks, reported by valgrind runs. Strange that they didn't
      show up earlier...
      286455bf