1. 04 Sep, 2014 13 commits
    • Dan Winship's avatar
      all: stop using virtual interface-name properties · ab26964c
      Dan Winship authored
      The virtual :interface-name properties (eg,
      NMDeviceBond:interface-name) are deprecated in favor of
      NMSettingConnection:interface-name, and nm_connection_verify() ensures
      that their values are kept in sync. So (a) there is no need to set
      those properties when we can just set
      NMSettingConnection:interface-name instead, and (b) we can replace any
      calls to the setting-specific get_interface_name() methods with
      nm_connection_get_interface_name() or
    • Dan Winship's avatar
      libnm-core: drop nm_{setting,connection}_get_virtual_iface_name() · 7314256b
      Dan Winship authored
      Since we enforce the fact that bond, bridge, team, and vlan
      interface-name properties match NMSettingConnection:interface-name,
      nm_connection_get_virtual_iface_name() can be replaced with
      nm_connection_get_interface_name() basically everywhere.
      The one place this doesn't work is with InfiniBand partitions (where
      get_virtual_iface_name() was actually computing the name), but for the
      most part we only need to care about the interface names of InfiniBand
      partitions in places where we also already need to do some other
      InfiniBand-specific handling as well, so we can use an
      InfiniBand-specific method
      (nm_setting_infiniband_get_virtual_interface_name()) to get it.
      (Also, while updating nm_device_get_virtual_device_description(), fix
      it to handle InfiniBand partitions too.)
    • Dan Winship's avatar
    • Dan Winship's avatar
      libnm-core: drop previously-deprecated NMSetting properties · a5ac95ca
      Dan Winship authored
      Drop the NMSetting properties that were marked deprecated in
      libnm-util in 0.9.10, but use nm_setting_class_add_dbus_property() to
      deal with them appropriately when serializing/deserializing.
    • Dan Winship's avatar
      libnm-core: add dbus-only properties to NMSettingClass · 002b19f4
      Dan Winship authored
      Add _nm_setting_class_add_dbus_only_property(), for declaring
      properties that appear in the D-Bus serialization, but which don't
      correspond to GObject properties.
      Since some property overrides will require examining settings other
      than the setting that they are on (eg, the value of
      802-11-wireless.security depends on whether an
      NMSettingWirelessSecurity setting is present, and
      NMSettingConnection:interface-name might sometimes be set from, eg,
      bond.interface-name), we also update _nm_setting_to_dbus() to take the
      full NMConnection as an argument, and _nm_setting_new_from_dbus() to
      take the full connection hash.
      Additionally, with some deprecated properties, we'll want to validate
      them on construction, but we don't need to keep the value around after
      that. So allow _nm_setting_new_from_dbus() to return a verification
      error directly, so we don't need to store the value until the verify()
    • Dan Winship's avatar
      libnm-core: clean up nm_connection_replace_settings()'s semantics · 504c292d
      Dan Winship authored
      On failure, nm_connection_replace_settings() would leave the
      connection in an undefined state. Fix it so that either (a) the
      settings are replaced and the resulting connection is valid and we
      return TRUE, or (b) the connection is untouched and we return FALSE
      and an error. (And add a test case for this.)
    • Dan Winship's avatar
      libnm-core: clarify nm_setting_lookup_type*() failure · 05f30681
      Dan Winship authored
      nm_setting_lookup_type() and nm_setting_lookup_type_by_quark() return
      G_TYPE_INVALID on failure.
    • Dan Winship's avatar
      libnm-core: reorganize _nm_setting_new_from_dbus() · c191c38a
      Dan Winship authored
      Reorganize _nm_setting_new_from_dbus() to create an empty NMSetting
      first and then set each of its properties, rather than passing all of
      the properties to g_object_newv(). We don't need to pass them at
      construct time since no NMSetting properties are CONSTRUCT_ONLY, and
      organizing the function this way is a prereq for some later
      functionality (being able to run code when a property *isn't* present
      in the hash).
    • Dan Winship's avatar
      libnm-core: rename NMConnection to/from_hash methods · 773d3f0a
      Dan Winship authored
      Rename nm_connection_to_hash() to nm_connection_to_dbus(), and
      nm_connection_new_from_hash() to nm_connection_new_from_dbus(). In
      addition to clarifying that this is specifically the D-Bus
      serialization format, these names will also work better in the
      GDBus-based future where the serialization format is GVariant, not
      Also, move NMSettingHashFlags to nm-connection.h, and rename it
    • Dan Winship's avatar
      libnm-core: make the NMSetting hash methods private · c9653a9e
      Dan Winship authored
      Make nm_setting_to_hash() and nm_setting_new_from_hash() private, and
      remove the public nm_setting_update_secrets() wrapper around the
      existing private _nm_setting_update_secrets().
      These functions should really only be called from the corresponding
      NMConnection-level methods, and in particular, with certain
      compatibility properties in the future, we will need to consider the
      entire connection all at once when setting properties, so it won't
      make sense to serialize/deserialize a single setting in isolation.
    • Dan Winship's avatar
      libnm-core, libnm-util: remove some useless code in nm-settings.c · 98e4a2be
      Dan Winship authored
      g_object_class_list_properties() can't return NULL if called
      Also remove two failed attempts to use g_value_transform():
      nm_setting_new_from_hash() was transforming src_value to its own type
      (rather than to param_spec->value_type, which was presumably
      intended), so it was a no-op (in addition to being unnecessary anyway,
      since GObject will attempt to transform the value internally if
      needed). And update_one_secret() was calling g_value_transform() on an
      uninitialized GValue, so it would have always hit a
      g_return_val_if_fail() in g_value_transform() if that code was ever
      reached (which apparently it wasn't).
    • Nilamdyuti Goswami's avatar
    • Dan Winship's avatar
      libnm-util: generate-plugin-docs.pl-related fixes · 799922c1
      Dan Winship authored
      generate-plugin-docs.pl was assuming that it was being run out of
      srcdir, and so failed in srcdir!=builddir builds (such as "make
      distcheck"). Fix that.
      Also, update .gitignore
  2. 03 Sep, 2014 2 commits
  3. 02 Sep, 2014 1 commit
    • Jiří Klimeš's avatar
      bluetooth: don't crash when switching off bluetooth · 151645a6
      Jiří Klimeš authored
      - add a bluetooth connection (with auto-activate)
        $ nmcli con add type blue con-name phone bt-type panu addr 00:17:EA:84:E7:41
      - make NM go to sleep (close a lid of laptop to suspend)
      - switch off hardware wireless button
      - resume the computer (open the lid)
      Trace (from RHEL 7):
       (NetworkManager:3619): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'NMDeviceBt'
       (NetworkManager:3619): GLib-GObject-CRITICAL **: g_type_instance_get_private: assertion 'instance != NULL && instance->g_class != NULL' failed
       NetworkManager[3619]: <warn> Error connecting with bluez: Timeout was reached
       (NetworkManager:3619): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'NMDevice'
       (NetworkManager:3619): GLib-GObject-CRITICAL **: g_type_instance_get_private: assertion 'instance != NULL && instance->g_class != NULL' failed
       Program received signal SIGSEGV, Segmentation fault.
       nm_device_state_changed (device=0x7f8ffe63c7f0, state=state@entry=NM_DEVICE_STATE_FAILED, reason=reason@entry=
           NM_DEVICE_STATE_REASON_BT_FAILED) at devices/nm-device.c:6685
       6685            g_warn_if_fail (priv->in_state_changed == FALSE);
       Missing separate debuginfos, use: debuginfo-install ModemManager-glib-1.1.0-6.git20130913.el7.x86_64 dbus-glib-0.100-7.el7.x86_64 dbus-libs-1.6.12-8.el7.x86_64 glib2-2.40.0-2.el7.x86_64 glibc-2.17-58.el7.x86_64 gvfs-1.16.4-7.el7.x86_64 libbluray-0.2.3-5.el7.x86_64 libffi-3.0.13-11.el7.x86_64 libgcc-4.8.3-5.el7.x86_64 libgudev1-208-11.el7_0.2.x86_64 libndp-1.2-4.el7.x86_64 libnl3-3.2.21-6.el7.x86_64 libselinux-2.2.2-6.el7.x86_64 libsoup-2.46.0-2.el7.x86_64 libuuid-2.23.2-16.el7.x86_64 libxml2-2.9.1-5.el7.x86_64 nspr-4.10.6-2.el7.x86_64 nss-3.16.2-4.el7.x86_64 nss-softokn-3.16.2-2.el7.x86_64 nss-softokn-freebl-3.16.2-2.el7.x86_64 nss-util-3.16.2-2.el7.x86_64 pcre-8.32-13.el7.x86_64 polkit-0.112-5.el7.x86_64 sqlite-3.7.17-4.el7.x86_64 systemd-libs-208-11.el7_0.2.x86_64 teamd-1.12-1.el7.x86_64 xz-libs-5.1.2-8alpha.el7.x86_64 zlib-1.2.7-13.el7.x86_64
       (gdb) DHCPREQUEST on enp0s25 to port 67 (xid=0x566289d3)
       DHCPACK from (xid=0x566289d3)
       #0  nm_device_state_changed (device=0x7f8ffe63c7f0, state=state@entry=NM_DEVICE_STATE_FAILED, reason=reason@entry=
           NM_DEVICE_STATE_REASON_BT_FAILED) at devices/nm-device.c:6685
       #1  0x00007f8fee0847bf in bluez_connect_cb (object=<optimized out>, res=<optimized out>, user_data=<optimized out>)
           at nm-device-bt.c:738
       #2  0x00007f8ff93eb557 in g_simple_async_result_complete (simple=0x7f8ffe67d8a0) at gsimpleasyncresult.c:763
       #3  0x00007f8fee07ec85 in bluez_connect_cb (dbus_connection=<optimized out>, res=0x7f8ffe67d730, user_data=<optimized out>)
           at nm-bluez-device.c:484
       #4  0x00007f8ff93eb557 in g_simple_async_result_complete (simple=0x7f8ffe67d730) at gsimpleasyncresult.c:763
       #5  0x00007f8ff944637f in g_dbus_connection_call_done (source=<optimized out>, result=<optimized out>, user_data=0x7f8ffe64a840)
           at gdbusconnection.c:5492
       #6  0x00007f8ff93eb557 in g_simple_async_result_complete (simple=0x7f8ffe66de30) at gsimpleasyncresult.c:763
       #7  0x00007f8ff93eb5b9 in complete_in_idle_cb (data=<optimized out>) at gsimpleasyncresult.c:775
       #8  0x00007f8ff8c3b9ea in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
       #9  0x00007f8ff8c3bd38 in g_main_context_iterate.isra.24 () from /lib64/libglib-2.0.so.0
       #10 0x00007f8ff8c3c00a in g_main_loop_run () from /lib64/libglib-2.0.so.0
       #11 0x00007f8ffcaba9ba in main (argc=1, argv=0x7ffff6b335b8) at main.c:642
  4. 01 Sep, 2014 1 commit
  5. 29 Aug, 2014 19 commits
  6. 28 Aug, 2014 2 commits
    • Jiří Klimeš's avatar
      trivial: only use spaces in nm-setting.xml · def5d6c3
      Jiří Klimeš authored
      Do not mix tabs and spaces for indentation, only use spaces.
    • Jiří Klimeš's avatar
      settings: fix a crash in emit_updated() accessing invalid pointer · f6b4ab7d
      Jiří Klimeš authored
      by disconnecting signal handlers in dispose().
      Commit 6a19e68a moved nm_connection_clear_secrets() from plugins' finalize() to
      NMSettingsConnection's dispose(). But clearing secrets emits "changed" signal
      which cause changed_cb() to be called and emit_updated() scheduled. And
      emit_updated() was called later after finalize() on released object.
      The crash can be invoked by having two keyfile connection files with the same
      uuid in them.
       (NetworkManager:12262): GLib-GObject-WARNING **: attempt to retrieve private data for invalid type 'NMSettingsConnection'
       Program received signal SIGSEGV, Segmentation fault.
       emit_updated (self=0xf38dd0 [NMSettingConnection]) at settings/nm-settings-connection.c:401
       401		NM_SETTINGS_CONNECTION_GET_PRIVATE (self)->updated_idle_id = 0;
       (gdb) bt
       #0  emit_updated (self=0xf38dd0 [NMSettingConnection]) at settings/nm-settings-connection.c:401
       #1  0x0000003c49647825 in g_main_dispatch (context=0x785970) at gmain.c:2539
       #2  g_main_context_dispatch (context=context@entry=0x785970) at gmain.c:3075
       #3  0x0000003c49647b58 in g_main_context_iterate (context=0x785970, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3146
       #4  0x0000003c49647f52 in g_main_loop_run (loop=0x7857c0) at gmain.c:3340
       #5  0x000000000042d4e9 in main (argc=1, argv=0x7fffffffe508) at main.c:679
  7. 27 Aug, 2014 2 commits