1. 03 Jul, 2019 1 commit
  2. 02 Jul, 2019 13 commits
    • Dan Williams's avatar
      cli: complete *-slave types (bond-slave, bridge-slave, team-slave) · f0e4137e
      Dan Williams authored
      While shorthand for "type ethernet slave-type <foo>" they are accepted
      as types by nmcli so we might as well complete them.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1654062
      
      !193
      f0e4137e
    • Thomas Haller's avatar
      e92dca35
    • Thomas Haller's avatar
      core: create virtual device on settings changes in idle handler · c163207b
      Thomas Haller authored
      The callback from NMSettings about adding/updating a settings comes
      from a deep call-stack already. We don't know the context of it, and
      we shouldn't just right away create the profile. Instead, schedule an
      action to create it in an idle handler.
      c163207b
    • Thomas Haller's avatar
      ifcfg-rh: refactor code re-reading profile from disk after write · 42a03481
      Thomas Haller authored
      The function only has one caller and it should be simple enough
      to perform the necessary steps right in nms_ifcfg_rh_writer_write_connection().
      
      More functions don't (always) simplify the code.
      42a03481
    • Thomas Haller's avatar
      device: fix crash releasing destroyed slave · 5b98f2fb
      Thomas Haller authored
      I encountered this on a WIP branch, but I think it can happen
      under regular conditions. I think there is no error condition here,
      and we should do nothing if we have no ifindex.
      
        <debug> [1561653068.2192] platform: signal: link removed: 1699: test1p <DOWN;broadcast,multicast> mtu 1500 master 1698 arp 1 veth* init addrgenmode none addr D6:14:45:97:06:75 brd FF:FF:FF:FF:FF:FF driver veth rx:0,0 tx:38,5606
        ...
        <info>  [1561653068.2617] device (test1): state change: activated -> unmanaged (reason 'unmanaged', sys-iface-state: 'removed')
        ...
        <trace> [1561653068.2635] device[0x564058c73750] (test1p): sys-iface-state: external -> removed
        <debug> [1561653068.2635] device[0x564058c73750] (test1p): unrealize (ifindex 1699)
        <debug> [1561653068.2636] device[0x564058c73750] (test1p): parent: clear
        <trace> [1561653068.2636] device[0x564058b98eb0] (vethbr): mtu: commit-mtu...
        <debug> [1561653068.2639] device[0x564058c73750] (test1p): unmanaged: flags set to [platform-init,!sleeping,!by-type,!user-explicit,!user-settings,!user-udev,!is-slave=0x10/0x1479/unmanaged/unrealized], set-unmanaged [platform-init=0x10])
        <debug> [1561653068.2639] device[0x564058c73750] (test1p): unmanaged: flags set to [platform-init,!sleeping,!user-settings=0x10/0x51/unmanaged/unrealized], forget [parent,by-type,user-explicit,user-udev,external-down,is-slave=0x1c2c])
        <info>  [1561653068.2639] device (test1p): state change: activated -> unmanaged (reason 'unmanaged', sys-iface-state: 'removed')
        <debug> [1561653068.2640] device[0x564058c73750] (test1p): deactivating device (reason 'unmanaged') [3]
        <trace> [1561653068.2640] device[0x564058c73750] (test1p): ip4-state: set to 0 (none)
        <trace> [1561653068.2640] device[0x564058c73750] (test1p): ip6-state: set to 0 (none)
        <trace> [1561653068.2640] device[0x564058c73750] (test1p): remove_pending_action (0): 'dhcp6' not pending (expected)
        <trace> [1561653068.2640] device[0x564058c73750] (test1p): remove_pending_action (0): 'autoconf6' not pending (expected)
        <debug> [1561653068.2640] rules-manager: sync
        <debug> [1561653068.2640] device[0x564058c73750] (test1p): set metered value 0
        <debug> [1561653068.2641] device[0x564058c73750] (test1p): ip4-config: update (commit=1, new-config=(nil))
        <debug> [1561653068.2641] device[0x564058c73750] (test1p): ip6-config: update (commit=1, new-config=(nil))
        <debug> [1561653068.2644] device[0x564058b98eb0] (vethbr): slave test1p state change 100 (activated) -> 10 (unmanaged)
        <trace> [1561653068.2644] device[0x564058b98eb0] (vethbr): master: release one slave 0x564058c73750/test1p
        ((src/platform/nm-platform.c:2002)): assertion '<dropped>' failed
      
      backtrace:
        ...
        #3  0x0000564057fb713e _nm_g_return_if_fail_warning (NetworkManager)
        #4  0x000056405808b37c release_slave (NetworkManager)
        #5  0x0000564058079aef nm_device_master_release_one_slave (NetworkManager)
        #6  0x00005640580844d7 slave_state_changed (NetworkManager)
        #7  0x00007efc24833fae ffi_call_unix64 (libffi.so.6)
        #8  0x00007efc2483396f ffi_call (libffi.so.6)
        #9  0x00007efc29b836e5 g_cclosure_marshal_generic (libgobject-2.0.so.0)
        #10 0x00007efc29b82c1d g_closure_invoke (libgobject-2.0.so.0)
        #11 0x00007efc29b96173 signal_emit_unlocked_R (libgobject-2.0.so.0)
        #12 0x00007efc29b9f29a g_signal_emit_valist (libgobject-2.0.so.0)
        #13 0x00007efc29b9f893 g_signal_emit (libgobject-2.0.so.0)
        #14 0x000056405807ab20 _set_state_full (NetworkManager)
        #15 0x000056405807d803 nm_device_unrealize (NetworkManager)
        #16 0x0000564057f6072c _platform_link_cb_idle (NetworkManager)
        #17 0x00007efc296a01db g_idle_dispatch (libglib-2.0.so.0)
        ...
      5b98f2fb
    • Thomas Haller's avatar
      7c84227c
    • Lubomir Rintel's avatar
      merge: branch 'lr/initrd-fixes' · 26317ec7
      Lubomir Rintel authored
      !194
      26317ec7
    • Lubomir Rintel's avatar
    • Lubomir Rintel's avatar
      initrd: don't create a default connection if there's already one · 6da20582
      Lubomir Rintel authored
      Certain arguments (such as "nameserver") don't specify a connection they
      apply to and using them would generate a default ethernet connection.
      This is probably not the right thing to do.
      6da20582
    • Lubomir Rintel's avatar
    • Lubomir Rintel's avatar
      initrd: allow specifying the net mask in form of a prefix · 390d7907
      Lubomir Rintel authored
      This is not documented in dracut.cmdline(7), however it seems to have
      worked and has users and Red Hat even seems to recommend this (thanks to
      Dan Horak for the pointers):
      
      https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/chap-installer-booting-ipl-s390
      https://bugzilla.redhat.com/show_bug.cgi?id=1725872
      390d7907
    • Lubomir Rintel's avatar
      initrd: remove an accidental backspace · 920e5901
      Lubomir Rintel authored
      920e5901
    • Lubomir Rintel's avatar
      initrd: fix error reporting on bad netmask · 4b097e31
      Lubomir Rintel authored
      It says the address is bad, but what is wrong is the mask.
      4b097e31
  3. 29 Jun, 2019 1 commit
  4. 28 Jun, 2019 8 commits
  5. 27 Jun, 2019 3 commits
  6. 26 Jun, 2019 14 commits
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      tools: export more symbols from NetworkManager binary to plugins · 7b6f1c2d
      Thomas Haller authored
      Plugins also may use nmtst_*() functions (when built with --with-more-asserts)
      or c_list_*(). Whitelist them too.
      7b6f1c2d
    • Thomas Haller's avatar
      ifcfg-rh: add allow_filename_cb() argument to write-ifcfg-rh function · e36cf1e8
      Thomas Haller authored
      The function determines the filename automatically, but we
      need to blacklist certain names.
      
      That is, because NetworkManager keeps a list of loaded files
      in memory. When writing a new file, we really want to choose
      a filename that is not yet taken. For that we must not only
      consider files on disk, but also files that existed on the last
      time of loading.
      e36cf1e8
    • Thomas Haller's avatar
      ifcfg-rh: cleanup utils_detect_ifcfg_path() · e5b21344
      Thomas Haller authored
      - avoid cloing the basename. Determining the basename can be done conveniently
        with strrchr().
      - use cleanup macro for temporary variable.
      - while in practice it should not happen, check that the colon in the name
        of alias file names is not followed by another '/'.
      e5b21344
    • Thomas Haller's avatar
      settings: cache agent and system secrets in a GVariant only · a4642c78
      Thomas Haller authored
      We don't need the full NMConnection.
      a4642c78
    • Thomas Haller's avatar
      manager: don't consider by-user change flag for creating unrealized device · f8a20d0a
      Thomas Haller authored
      This effectively reverts commit [1].
      
      The by-user argument is not very clear what it means. Is a "nmcli
      connection load $FILENAME" a user-action? How about reload?
      
      I don't know whether the problem that this was supposed to fix is still
      present. But in any case, the condition here seems not right. It's
      already hard to understand when and how we generate unrealized devices.
      
      If the condition from commit [1] should be prevented, then it must happen
      somehow differently. In the example, the offending connection is a generated
      volatile profile with the device being sys-face-state "external". Of course,
      we should not generate devices for such profiles nor autoactivating them.
      So adding a device for a volatile connection is always wrong. Don't do that,
      which should avoid the original problem.
      
      [1] commit a8a4eb14 ('manager: don't create the virtual devices on all connection changes')
      f8a20d0a
    • Thomas Haller's avatar
      core: ensure normalized connection during add-and-activate · d1f269ab
      Thomas Haller authored
      nm_connection_verify() returns success for fully valid (normalized)
      connections and also connections that are NM_SETTING_VERIFY_NORMALIZABLE.
      
      We really want to fully normalize the profiles during add-and-activate.
      d1f269ab
    • Thomas Haller's avatar
      settings: reorder checks in _delete_volatile_connection_do() to perform cheaper check first · 6d459235
      Thomas Haller authored
      Checking whether a settings connection is still tracked is a simple
      c_list_is_empty(). It's faster, so do it first.
      6d459235
    • Thomas Haller's avatar
      settings: use NMCListElem instead of DeleteVolatileConnectionData for tracking... · 50e193d1
      Thomas Haller authored
      settings: use NMCListElem instead of DeleteVolatileConnectionData for tracking connections to delete
      
      For tracking a CList of one pointer we have NMCListElem API. We don't need
      to implement our own struct to hold the list pointers and the data pointer.
      50e193d1
    • Thomas Haller's avatar
      settings: don't implement settings plugins as singletons · eed4b525
      Thomas Haller authored
      The settings plugins are created by NMSettings when the plugin
      gets loaded. There is no need for these instances to be singletons
      or to have a singleton getter.
      
      Also, while in practice we create a settings plugin instance of
      each type only once, there is nothing that would prevent creating
      multiple instances. Hence, having a singleton getter is not right.
      
      What is however useful, is to track them and block shutdown
      via nm_shutdown_wait_obj_register*(). While the actual waiting
      is not yet implemented, we should mark the plugin instances to
      block shutdown (in the future).
      eed4b525
    • Thomas Haller's avatar
      core: add flag to nm_shutdown_wait_obj_register_full() for freeing allcated message string · a4108734
      Thomas Haller authored
      In fact, nm_shutdown_wait_obj_register*() API is still not implemented
      and registering an object has no effect currently. That is, blocking
      shutdown and waiting for instances to be destroyed during shutdown
      is not yet implemented. Still, we already implement the API so that
      components can register themself to block the shutdown. The point is
      of course, that the callers already use this API, although it's not yet
      implemented.
      
      Anyway, sometimes the message string is not static. Add an option to
      pass an allocated string and let the string be destroyed when no longer
      needed.
      a4108734
    • Thomas Haller's avatar
      libnm: fix setting error for nm_connection_update_secrets() · 02a09675
      Thomas Haller authored
      By convention, a function that indicates failure *MUST* set
      an error.
      
      Also, an error can only be set once.
      02a09675
    • Thomas Haller's avatar
      libnm: workaround assertion failure for nmtst_connection_assert_unchanging()... · d704f021
      Thomas Haller authored
      libnm: workaround assertion failure for nmtst_connection_assert_unchanging() when disposing connection
      
      nmtst_connection_assert_unchanging() registers to the changed signals
      and asserts that they are not invoked. The purpose is that sometimes
      we want to keep a reference to an NMConnection and be sure that it does
      not get modified. This allows everybody to keep a reference to the very
      same connection instance without cloning it -- provided they too promise
      not to change it. This assert is to ensure that.
      
      Note that NMSimpleConnection.dispose() clears the secrets and thus upon
      destruction the assertion fails. At that point, the assertion is no longer
      relevant, because the purpose was to ensure that no alive instances gets
      modified. While destroying the instance, it's fine to modify it (nobody should
      have a reference to it anymore).
      
      This avoids the assertion failure when destroying a NMSimpleConnection with secrets
      that is set with nmtst_connection_assert_unchanging().
      d704f021
    • Thomas Haller's avatar