Commit graph

12364 commits

Author SHA1 Message Date
Thomas Haller
ea7063dbc2 libnm: fix gtkdoc for nm_utils_enum_to_str() and nm_utils_enum_from_str()
Fixes: 8be9814793
(cherry picked from commit 97ec44f593)
2015-08-21 18:12:36 +02:00
Beniamino Galvani
26d6d5c1da core: configure Wake-on-LAN parameters for Ethernet devices
(cherry picked from commit 996cbcd25c)
2015-08-21 18:12:36 +02:00
Beniamino Galvani
f7811e87b8 cli: add support for Wake-on-LAN settings
(cherry picked from commit de92df6c9f)
2015-08-21 18:12:36 +02:00
Beniamino Galvani
fc91d538f5 ifcfg-rh: add support for Wake-on-LAN ethtool options
Based on branch danw/wip/ethtool by Dan Winship <danw@redhat.com>

(cherry picked from commit 2e0d0bc050)
2015-08-21 18:12:36 +02:00
Beniamino Galvani
d449d82304 libnm-core: add Wake-on-LAN properties to NMSettingWired
(cherry picked from commit 5622461c04)
2015-08-21 18:12:36 +02:00
Beniamino Galvani
f4ce6760e0 libnm-core: add enum conversion utilities
Add functions nm_utils_enum_to_str() and nm_utils_enum_from_str()
which can be used to perform conversions between enum values and
strings, passing the GType automatically generated for every enum by
glib-mkenums.

(cherry picked from commit 8be9814793)
2015-08-21 18:12:36 +02:00
Jiří Klimeš
3b3f5fa755 libnm: fix the callback in g_simple_async_result_new()
(cherry picked from commit 79db8e83e1)
2015-08-21 13:43:05 +02:00
Jiří Klimeš
7b47b5e740 merge: Wi-Fi band/channel locking fixes (bgo #627571)
- fixes value for 'freq_list' wpa_supplicant option
 - allows locking to a channel within a band
 - adds utility functions for getting Wi-Fi frequencies

https://bugzilla.gnome.org/show_bug.cgi?id=627571
2015-08-21 10:00:45 +02:00
Jiří Klimeš
d80f1fee87 wifi: also support locking connections to a channel within band (bgo #627571)
https://bugzilla.gnome.org/show_bug.cgi?id=627571
(cherry picked from commit c0f6725146)
2015-08-21 09:50:55 +02:00
Jiří Klimeš
b19f3d9ac2 supplicant: use util functions for Wi-Fi frequencies
(cherry picked from commit 3c122235dc)
2015-08-21 09:50:55 +02:00
Jiří Klimeš
77bf69c3dc libnm: add utility functions for getting 2.4 GHz and 5 GHz Wi-Fi frequencies
nm_utils_wifi_2ghz_freqs()
nm_utils_wifi_5ghz_freqs()

(cherry picked from commit 1a6b631690)
2015-08-21 09:50:49 +02:00
Jiří Klimeš
c8b5b5eb1c supplicant: wpa_supplicant wants space-separated list in freq_list (bgo #627571)
See https://w1.fi/cgit/hostap/tree/wpa_supplicant/wpa_supplicant.conf#n663

(cherry picked from commit 4fe6bdcbb5)
2015-08-21 09:45:38 +02:00
Thomas Haller
068b525be3 platform: downgrade the warning about cache-sync to info level
It can happen on a regular basis when many events get raised.
It is probalby not avoidable and most likely not an issue, so
downgrade the warning to info level.

(cherry picked from commit 7f9cb13057)
2015-08-20 18:16:17 +02:00
Thomas Haller
3d8becc23a merge: improve logging macros and add _LOG() macros to NMActiveConnection,NMSettingsConnection 2015-08-20 18:14:37 +02:00
Thomas Haller
45c85a0d6b logging: declare default logging macros in "nm-logging.h"
The logging macros _LOGD(), etc. are specific to each
file as they format the message according to their context.

Still, they were cumbersome to define and their implementation
was repeated over and over (slightly different at times).

Move the declaration of these macros to "nm-logging.h".
The source file now only needs to define _NMLOG(), and either
_NMLOG_ENABLED() or _NMLOG_DOMAIN.

This reduces code duplication and encourages a common implementation
and usage of these macros.

(cherry picked from commit ad7cdfc766)
2015-08-20 18:05:43 +02:00
Thomas Haller
d7e36972c7 core: print connection path in nm_utils_log_connection_diff()
(cherry picked from commit 4c48f66d3d)
2015-08-20 18:05:43 +02:00
Thomas Haller
f202a16026 settings: use _LOG() macros in "nm-settings-connection.c"
(cherry picked from commit a6e7b96963)
2015-08-20 18:05:43 +02:00
Thomas Haller
6a2c021559 settings: refactor logging statement in nm_settings_connection_get_secrets()
(cherry picked from commit 0dcd7b2208)
2015-08-20 18:05:43 +02:00
Thomas Haller
e125603450 libnm-core: don't assert in nm_connection_get_uuid() for valid connection
We want to call nm_connection_get_uuid() also on connections that don't verify.
Otherwise it is chumbersome to check first for verified connection.

(cherry picked from commit 61eed191a9)
2015-08-20 18:05:43 +02:00
Thomas Haller
494b52a832 settings: add _LOG() macros to "nm-settings-connection.h"
(cherry picked from commit 5fb56a1df9)
2015-08-20 18:05:43 +02:00
Thomas Haller
1b3bb295c5 settings/trivial: consistently name @self argument in NMSettingsConnection
(cherry picked from commit 0a160116d7)
2015-08-20 18:05:43 +02:00
Thomas Haller
462b955516 active-connection: make use of logging macro _LOGD()
(cherry picked from commit 97c971b4e4)
2015-08-20 18:05:24 +02:00
Thomas Haller
0621b8b839 active-connection: add logging macros _LOG*()
(cherry picked from commit c6cbd652ba)
2015-08-20 17:54:17 +02:00
Beniamino Galvani
8482f06090 device: don't clear @master on cleanup when the link is still enslaved
Don't clear NMDevice @master in nm_device_cleanup() if the device link
is still enslaved because this causes an inconsistent state in which
the slave in included in the @slaves field of master device but
@master of slave device is NULL.

In such state, if the master link gets deleted, NM receives a change
event for each slave and a deletion event for the master; the change
events should also remove slaves from @slaves of master device, but
since their @master field is NULL the removal can't be performed.

Later, when the master deletion event is received, @slaves is not empty
in dispose() of NMDevice and the following assertion is triggered:

  dispose: runtime check failed: (priv->slaves == NULL)

https://bugzilla.redhat.com/show_bug.cgi?id=1243371
(cherry picked from commit b557f91a1b)
2015-08-20 08:58:29 +02:00
Lubomir Rintel
ad0ab5e827 udev-rules: avoid ifname shell expansion
(cherry picked from commit 9a65f63cb9)
2015-08-19 15:18:14 +02:00
Lubomir Rintel
3fe9825a4b udev-rules: one less useless use of cat
(cherry picked from commit bafc26d008)
2015-08-19 14:30:34 +02:00
Beniamino Galvani
2853fa9a42 udev-rules: only invoke ethtool for existing interfaces
ethtool may cause the auto-loading of a kernel module for non-existing
interface-names. Avoid that by checking whether such an interface exists.

(cherry picked from commit 9366bd7f90)
2015-08-19 14:30:28 +02:00
Lubomir Rintel
5a422d385e Revert "udev-rules: only invoke ethtool for existing interfaces"
This reverts commit 44fee0f6ff.

Bad quoting here. Also, this is not quite the best fix for the issue,
filtering on ACTION=="add" is probably a bit more elegant.

(cherry picked from commit b0f3250dfb)
2015-08-19 14:30:24 +02:00
Jiří Klimeš
9377c08d10 merge: merge contrib/scripts directory with VPN import scripts 2015-08-19 13:16:44 +02:00
Jiří Klimeš
239bb736bc nm-import-openvpn: import 'keepalive' option
https://bugzilla.gnome.org/show_bug.cgi?id=651657
https://git.gnome.org/browse/network-manager-openvpn/commit/?id=6afd16bcacd87a019e12f4df0d63a9e0e8c94e9e
(cherry picked from commit 02cfeac668)
2015-08-19 13:15:17 +02:00
Jiří Klimeš
22902cc31d nm-import-openvpn: import 'ping', 'ping-exit' and 'ping-restart' options
https://bugzilla.gnome.org/show_bug.cgi?id=651657
https://git.gnome.org/browse/network-manager-openvpn/commit/?id=054cc997ca38e5d786859fa6d032c4404af3d28a
(cherry picked from commit e655358d44)
2015-08-19 13:15:17 +02:00
Jiří Klimeš
75934cb13c nm-import-openvpn: improve error checking
(cherry picked from commit bde1cd342e)
2015-08-19 13:15:16 +02:00
Jiří Klimeš
753e668c48 nm-import-openvpn: fix importing OpenVPN configuration with 'tls-client'
(cherry picked from commit a646870684)
2015-08-19 13:15:16 +02:00
Jiří Klimeš
1cac4ed5b8 nm-import-openvpn: import 'float' OpenVPN option
https://bugzilla.gnome.org/show_bug.cgi?id=737108

Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
(cherry picked from commit a5e43ab510)
2015-08-19 13:15:16 +02:00
Jiří Klimeš
9543f2ef73 contrib/scripts: fix importing 'remote' and 'remote-random' options for openvpn
see https://bugzilla.redhat.com/show_bug.cgi?id=1194643

(cherry picked from commit 466515e953)
2015-08-19 13:15:16 +02:00
Jiří Klimeš
6b8dee613f contrib/scripts: nm-import-openconnect - script for importing OpenConnect VPN configs to NM
(cherry picked from commit 29473f1bc4)
2015-08-19 13:15:16 +02:00
Jiří Klimeš
946e157d85 contrib/scripts: nm-import-vpnc - script for importing Cisco VPN configs to NM
(cherry picked from commit db0cf1e7f6)
2015-08-19 13:15:16 +02:00
Jiří Klimeš
701bb6d846 contrib/scripts: nm-import-openvpn - script for importing OpenVPN configs to NM
Synopsis:
 $ nm-import-openvpn -i <infile1> <infile2> ...

 $ nm-import-openvpn <infile> <outfile>

Put the file to NetworkManager:
 # cp <outfile> /etc/NetworkManager/system-connections/
 # chmod 600 /etc/NetworkManager/system-connections/<outfile>
 # nmcli con load /etc/NetworkManager/system-connections/<outfile>

(cherry picked from commit 1a2798d1a4)
2015-08-19 13:15:15 +02:00
Thomas Haller
0cbe203d7c supplicant: don't log a warning when scan request fails
This downgrades the following warning down to debug-level.

  <warn>  Could not get scan request result: GDBus.Error:fi.w1.wpa_supplicant1.Interface.ScanError: Scan request rejected

It seems this ~error~ happens regularly, so warning about it is overly
alarming.

(cherry picked from commit ebc387638a)
2015-08-19 12:59:40 +02:00
Dan Winship
2b78a1d53b libnm-core: add _nm_dbus_error_has_name()
Add a method for checking the D-Bus error name of an error.

(cherry picked from commit ec6f350f44)
2015-08-19 12:59:39 +02:00
Thomas Haller
e04c3139ef manager: fix memleak in system_hostname_changed_cb()
Also, no need to clone the hostname again.

Fixes: c9067d8fed
(cherry picked from commit 58a2e99294)
2015-08-18 15:16:33 +02:00
Lubomir Rintel
502b45f0d4 tests: raise the mock service startup timeout
Python is just too slow on some machines. Needed around twice the previous
limit on BCM2835 with Pidora 20, let's add some safety margin too.

(cherry picked from commit 81cc4d27b1)
2015-08-17 10:54:05 +02:00
Jiří Klimeš
7f3115e0ec merge: 'ssids' RequestScan() option, nmcli connecting hidden SSID (rh #752173)
Add 'ssids' option to RequestScan() DBus call allowing scanning multiple SSIDs,
support that in libnm and nmcli. And fix nmcli for connecting to hidden SSIDs.

https://bugzilla.gnome.org/show_bug.cgi?id=752173
2015-08-14 13:49:09 +02:00
Jiří Klimeš
e0762f4f22 cli: fix connecting to a hidden SSID with 'nmcli dev wifi connect' (bgo #752173)
We have to set 802-11-wireless.hidden=true to be able to connect to hidden SSIDs.
nmcli user indicates hidden SSID with 'hidden yes' parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=752173

(cherry picked from commit 5955a66e09)
2015-08-14 13:32:10 +02:00
Jiří Klimeš
b1f62ce2cd cli: add 'ssid' parameter for 'nmcli device wifi rescan'
'ssid' can repeat when more SSIDs should be scanned, e.g.
$ nmcli dev wifi rescan ssid "hidden cafe" ssid AP12 ssid "my home Wi-Fi"

Bash completion fixed by thaller@redhat.com

(cherry picked from commit e247567d87)
2015-08-14 13:30:17 +02:00
Jiří Klimeš
91c0555afa libnm: add new functions allowing passing options to RequestScan() D-Bus call
nm_device_wifi_request_scan_options()
nm_device_wifi_request_scan_options_async()

(cherry picked from commit 7691fe5753)
2015-08-14 13:30:17 +02:00
Jiří Klimeš
7706b99250 core: accept 'ssids':aay option in RequestScan() dictionary parameter
It allows specifying SSIDs that should be probe-scanned, which is useful
for APs with hidden SSID, for example.

(cherry picked from commit 87b2d783b6)
2015-08-14 13:30:11 +02:00
Lubomir Rintel
4956ac6475 device: avoid a crash during destruction
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)

(cherry picked from commit 688e93fb2a)
2015-08-14 10:46:20 +02:00
Thomas Haller
7e2caa2146 ifcfg-rh: take reference to nm_inotifiy_helper_get() singleton in NMIfcfgConnection
https://bugzilla.redhat.com/show_bug.cgi?id=1253330
(cherry picked from commit 088e606fcc)
2015-08-13 16:23:26 +02:00
Jiří Klimeš
677ba11a0f cli: fix an bug when reporting an error
$ nmcli dev wifi rescan ifname eteee

(process:21211): libnm-CRITICAL **: nm_device_get_device_type: assertion 'NM_IS_DEVICE (self)' failed
Error: Device 'eteee' is not a Wi-Fi device.

Fixes: 823df334ed
(cherry picked from commit bccc1af51b)
2015-08-13 09:56:19 +02:00