1. 17 Sep, 2018 2 commits
  2. 15 Sep, 2018 1 commit
  3. 14 Sep, 2018 6 commits
    • Thomas Haller's avatar
      libnm: drop API nm_connection_get_setting_{6lowpan,sriov,wpan}() · fe866fbe
      Thomas Haller authored
      Note that NMSettingEthtool and NMSettingMatch don't have such
      functions either.
      
      We have API
      
        nm_connection_get_setting (NMConnection *, GType)
        nm_connection_get_setting_by_name (NMConnection *, const char *)
      
      which can be used generically, meaning: the requested setting type
      is an argument to the function. That is generally more useful and
      flexible.
      
      Don't add API which duplicates existing functionality and is (arguably)
      inferiour. Drop it now. This is an ABI/API break for the current development
      cycle where the 1.14.0 API is still unstable. Indeed it's already after
      1.14-rc1, which is ugly. But it's also unlikely that somebody already uses
      this API/ABI and is badly impacted by this change.
      
      Note that nm_connection_get_setting() and nm_connection_get_setting_by_name()
      are slightly inconvenient in C still, because they usually require a cast.
      We should fix that by changing the return type to "void *". Such
      a change may be possibly any time without breaking API/ABI (almost, it'd
      be an API change when taking a function pointer without casting).
      
      (cherry picked from commit a10156f5)
      fe866fbe
    • Thomas Haller's avatar
      libnm: drop API nm_connection_get_setting_{6lowpan,sriov,wpan}() · a10156f5
      Thomas Haller authored
      Note that NMSettingEthtool and NMSettingMatch don't have such
      functions either.
      
      We have API
      
        nm_connection_get_setting (NMConnection *, GType)
        nm_connection_get_setting_by_name (NMConnection *, const char *)
      
      which can be used generically, meaning: the requested setting type
      is an argument to the function. That is generally more useful and
      flexible.
      
      Don't add API which duplicates existing functionality and is (arguably)
      inferiour. Drop it now. This is an ABI/API break for the current development
      cycle where the 1.14.0 API is still unstable. Indeed it's already after
      1.14-rc1, which is ugly. But it's also unlikely that somebody already uses
      this API/ABI and is badly impacted by this change.
      
      Note that nm_connection_get_setting() and nm_connection_get_setting_by_name()
      are slightly inconvenient in C still, because they usually require a cast.
      We should fix that by changing the return type to "void *". Such
      a change may be possibly any time without breaking API/ABI (almost, it'd
      be an API change when taking a function pointer without casting).
      a10156f5
    • Thomas Haller's avatar
      vpn: disconnect signal handlers from proxy in NMVpnConnection::dispose() · f71f9b54
      Thomas Haller authored
      We cannot be sure who holds a reference to the proxy, and
      who is gonna call us back after the VPN connection instance
      is destroyed.
      
      (cherry picked from commit 6ebb9091)
      f71f9b54
    • Thomas Haller's avatar
      vpn: fix assertion during "SecretsRequired" in unexpected state · 011dd919
      Thomas Haller authored
      Got this assertion:
      
          NetworkManager[12939]: <debug> [1536917977.4868] active-connection[0x563d8fd34540]: set state deactivated (was deactivating)
          ...
          NetworkManager[12939]: nm-openvpn[1106] <info>  openvpn[1132]: send SIGTERM
          NetworkManager[12939]: nm-openvpn[1106] <info>  wait for 1 openvpn processes to terminate...
          NetworkManager[12939]: nm-openvpn[1106] <warn>  openvpn[1132] exited with error code 1
          NetworkManager[12939]: <info>  [1536917977.5035] vpn-connection[0x563d8fd34540,2fdeaea3-975f-4325-8305-83ebca5eaa26,"my-openvpn-Red-Hat",0]: VPN plugin: requested secrets; state disconnected (9)
          NetworkManager[12939]: plugin_interactive_secrets_required: assertion 'priv->vpn_state == STATE_CONNECT || priv->vpn_state == STATE_NEED_AUTH' failed
      
      Meaning. We should either ensure that secrets_required_cb() signal callback
      is disconnected from proxy's signal, or we gracefully handle callbacks at
      unexpected moments. Do the latter.
      
      (cherry picked from commit 92344dd0)
      011dd919
    • Thomas Haller's avatar
      vpn: disconnect signal handlers from proxy in NMVpnConnection::dispose() · 6ebb9091
      Thomas Haller authored
      We cannot be sure who holds a reference to the proxy, and
      who is gonna call us back after the VPN connection instance
      is destroyed.
      6ebb9091
    • Thomas Haller's avatar
      vpn: fix assertion during "SecretsRequired" in unexpected state · 92344dd0
      Thomas Haller authored
      Got this assertion:
      
          NetworkManager[12939]: <debug> [1536917977.4868] active-connection[0x563d8fd34540]: set state deactivated (was deactivating)
          ...
          NetworkManager[12939]: nm-openvpn[1106] <info>  openvpn[1132]: send SIGTERM
          NetworkManager[12939]: nm-openvpn[1106] <info>  wait for 1 openvpn processes to terminate...
          NetworkManager[12939]: nm-openvpn[1106] <warn>  openvpn[1132] exited with error code 1
          NetworkManager[12939]: <info>  [1536917977.5035] vpn-connection[0x563d8fd34540,2fdeaea3-975f-4325-8305-83ebca5eaa26,"my-openvpn-Red-Hat",0]: VPN plugin: requested secrets; state disconnected (9)
          NetworkManager[12939]: plugin_interactive_secrets_required: assertion 'priv->vpn_state == STATE_CONNECT || priv->vpn_state == STATE_NEED_AUTH' failed
      
      Meaning. We should either ensure that secrets_required_cb() signal callback
      is disconnected from proxy's signal, or we gracefully handle callbacks at
      unexpected moments. Do the latter.
      92344dd0
  4. 13 Sep, 2018 12 commits
  5. 12 Sep, 2018 13 commits
  6. 11 Sep, 2018 6 commits
    • Thomas Haller's avatar
      ppp: cleanup logging in impl_ppp_manager_set_ifindex() · 2a45c32e
      Thomas Haller authored
      It's enough that all code paths in impl_ppp_manager_set_ifindex() log exactly
      one message. Also, give all messages the same prefix, so that it's clear where
      they come from.
      2a45c32e
    • Thomas Haller's avatar
      ppp: downgrade warning about repeated SetIfindex calls from ppp plugin · 4a443983
      Thomas Haller authored
      In src/ppp/nm-pppd-plugin.c, it seems that pppd can invoke
      phasechange(PHASE_RUNNING:) multiple times. Hence, the plugin
      calls SetIfindex multiple times too. In nm-ppp-manager.c, we
      want to make sure that the ifindex does not change after it
      was set once. However, calling SetIfindex with the same ifindex
      is not something worth warning. Just log a debug message and nothing.
      
      Maybe the plugin should remember that it already set the ifindex,
      and avoid multiple D-Bus calls. But it's unclear that that is desired.
      For now, just downgrade the warning.
      4a443983
    • Thomas Haller's avatar
      ppp: avoid strncpy() in ppp plugin nm_phasechange() · 4d11eba8
      Thomas Haller authored
      strncpy() is deemed insecure, and it raises at least an eyebrow.
      While it's save in this case, just avoid it.
      4d11eba8
    • Thomas Haller's avatar
      ppp-manager: avoid crash with nonexisting link in impl_ppp_manager_set_ifindex() · 7c50748d
      Thomas Haller authored
      Fixes: dd98ada3
      (cherry picked from commit 30a469e0)
      7c50748d
    • Frederic Danis's avatar
      ppp-manager: fix pppd not exiting correctly on modem hangup · b3ca8abe
      Frederic Danis authored
      When unplugging an USB 3G modem device, pppd does not exit correctly and
      we have the following traces:
      
      Sep 10 07:58:24.616465 ModemManager[1158]: <info>  (tty/ttyUSB0): released by device '/sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/usb4/4-1'
      Sep 10 07:58:24.620314 pppd[2292]: Modem hangup
      Sep 10 07:58:24.621368 ModemManager[1158]: <info>  (tty/ttyUSB1): released by device '/sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/usb4/4-1'
      Sep 10 07:58:24.621835 ModemManager[1158]: <warn>  (ttyUSB1): could not re-acquire serial port lock: (5) Input/output error
      Sep 10 07:58:24.621358 NetworkManager[1871]: <debug> ppp-manager: set-ifindex 4
      Sep 10 07:58:24.621369 NetworkManager[1871]: <warn>  ppp-manager: can't change the ifindex from 4 to 4
      Sep 10 07:58:24.623982 NetworkManager[1871]: <info>  device (ttyUSB0): state change: activated -> unmanaged (reason 'removed', sys-iface-state: 'removed')
      Sep 10 07:58:24.624411 NetworkManager[1871]: <debug> kill child process 'pppd' (2292): wait for process to terminate after sending SIGTERM (15) (send SIGKILL in 1500 milliseconds)...
      Sep 10 07:58:24.624440 NetworkManager[1871]: <debug> modem-broadband[ttyUSB0]: notifying ModemManager about the modem disconnection
      Sep 10 07:58:24.626591 NetworkManager[1871]: <debug> modem-broadband[ttyUSB0]: notifying ModemManager about the modem disconnection
      Sep 10 07:58:24.681016 NetworkManager[1871]: <warn>  modem-broadband[ttyUSB0]: failed to disconnect modem: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface 'org.freedesktop.ModemManager1.Modem.Simple' on object at path /org/freedesktop/ModemManager1/Modem/0
      Sep 10 07:58:26.126817 NetworkManager[1871]: <debug> kill child process 'pppd' (2292): process not terminated after 1502368 usec. Sending SIGKILL signal
      Sep 10 07:58:26.128121 NetworkManager[1871]: <info>  device (ppp0): state change: disconnected -> unmanaged (reason 'unmanaged', sys-iface-state: 'removed')
      Sep 10 07:58:26.135571 NetworkManager[1871]: <debug> kill child process 'pppd' (2292): terminated by signal 9 (1511158 usec elapsed)
      
      This is due to nm-ppp-plugin waiting on SetIfIndex call until timeout,
      which is longer than termination process timeout.
      
      Calling g_dbus_method_invocation_return_value() on error fixes this.
      
      Fixes: dd98ada3
      
      https://mail.gnome.org/archives/networkmanager-list/2018-September/msg00010.html
      (cherry picked from commit e66e4d0e)
      b3ca8abe
    • Thomas Haller's avatar