Commit Graph

13873 Commits

Author SHA1 Message Date
Jiří Klimeš
e655358d44 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
2015-08-19 12:23:04 +02:00
Jiří Klimeš
bde1cd342e nm-import-openvpn: improve error checking 2015-08-19 12:23:04 +02:00
Jiří Klimeš
a646870684 nm-import-openvpn: fix importing OpenVPN configuration with 'tls-client' 2015-08-19 10:58:29 +02:00
Dan Williams
4a627929c0 wwan: add missing include for DBUS_INTERFACE_PEER 2015-08-18 17:01:44 -05:00
Thomas Haller
ebc387638a 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.
2015-08-18 16:16:29 +02:00
Thomas Haller
58a2e99294 manager: fix memleak in system_hostname_changed_cb()
Also, no need to clone the hostname again.

Fixes: c9067d8fed
2015-08-18 14:44:25 +02:00
Thomas Haller
d9c4411402 core: fix leaking @properties in nm_exported_object_create_skeletons()
Fixes: 073991f5a8
2015-08-18 14:44:25 +02:00
Thomas Haller
e828bae171 core: fix memleak in nm_exported_object_notify()
g_dbus_gvalue_to_gvariant() returns a non-floating ref.

Fixes: 073991f5a8
2015-08-18 14:18:37 +02:00
Thomas Haller
3697e568ba core: fix impl_manager_get_devices() to skip non-exported objects
Must skip over NULL paths. Also, the previous version leaked the
object-paths as g_variant_new() doesn't take ownership.

Fixes: 34ba4e14b8
2015-08-18 13:53:47 +02:00
Thomas Haller
3dfbbb227e libnm: require exact vpn plugin filename
Originally, nm-applet loaded the vpn plugins by passing the filename
to g_module_open(). Thereby, g_module_open() allowed for missing file
extension and tries to complete the name with a system-dependent suffix.

When porting to libnm, we kept that behavior but did more elaborate
checks on the file, like checking owner and permissions.

Change to no longer trying to append the system suffix, but require
an exact path. That is no usability problem, because the plugin path
is specified in the .name files, and we just require them now to be the
full path (including the .so extension).
Note also, that this only affects new, libnm-based vpn plugins, thus there
is no change in behavior for legacy libnm-glib based plugins.

Fixes: eed0d0c58f
2015-08-18 12:08:11 +02:00
Lubomir Rintel
bafc26d008 udev-rules: one less useless use of cat 2015-08-18 08:45:42 +02:00
Beniamino Galvani
9366bd7f90 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.
2015-08-18 08:45:42 +02:00
Lubomir Rintel
b0f3250dfb 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.
2015-08-18 08:45:42 +02:00
Lubomir Rintel
1eedcb44fe libnm,vpn-service-plugin: fix double address-of for variants
They are already GVariant pointers.
2015-08-17 17:10:42 +02:00
Lubomir Rintel
bcf2b1295c libnm,vpn-service-plugin: emit signals also for the dbus skeleton
Otherwise they won't just reach the bus.

https://bugzilla.gnome.org/show_bug.cgi?id=753663
2015-08-17 17:10:42 +02:00
Lubomir Rintel
81cc4d27b1 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.
2015-08-17 10:53:11 +02:00
Beniamino Galvani
1d6e8e8da7 device: accept multiple addresses in a DHCPv6 lease
When the DHCPv6 lease received from the server contains multiple
addresses, dhclient generates a new BOUND event for each of
them. Instead of overwriting the previous IP6 configuration for each
BOUND event, we should try to detect if the new configuration belongs
to the same lease and merge its addresses with the existing one in
such case.

This allows NetworkManager to configure multiple addresses on an
interface via DHCPv6.

https://bugzilla.gnome.org/show_bug.cgi?id=681764
https://bugzilla.redhat.com/show_bug.cgi?id=1244293
2015-08-17 09:52:28 +02:00
Jiří Klimeš
acfa07a37d libnm: symbols for request scanning backported to 1.0.6
Backport to 1.0.6 the following symbols:
 - nm_device_wifi_request_scan_options
 - nm_device_wifi_request_scan_options_async

Backported by commit 91c0555afaac57234744f42024d95bde46ba170e
2015-08-14 14:29:05 +02:00
Jiří Klimeš
32c34a8ccd 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 12:50:33 +02:00
Jiří Klimeš
5955a66e09 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
2015-08-14 12:42:56 +02:00
Jiří Klimeš
e247567d87 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
2015-08-14 12:42:15 +02:00
Jiří Klimeš
7691fe5753 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()
2015-08-14 11:27:15 +02:00
Jiří Klimeš
87b2d783b6 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.
2015-08-14 11:27:15 +02:00
Jiří Klimeš
b019052b92 settings: fix format string for GVariant (rh #1253320)
https://bugzilla.redhat.com/show_bug.cgi?id=1253320

Fixes: df6706813a
2015-08-13 17:46:56 +02:00
Lubomir Rintel
60372f1090 build: create xz compressed by default
GNOME release tooling repacks the bz2 to a xz anyway. This makes it easier for
packagers to use tarballs created with "make dist" in place of distribution
tarballs.
2015-08-13 17:22:44 +02:00
Thomas Haller
cad5406417 core: avoid assertion "signal_id != 0" on unexported object
When unexporting an object, we might have a notification
pending. When the notification is finally processed, it
would find no "priv->interfaces" and raise an assertion

  "idle_emit_properties_changed: assertion 'signal_id != 0' failed"

https://bugzilla.redhat.com/show_bug.cgi?id=1253326

Fixes: 073991f5a8
2015-08-13 17:20:07 +02:00
Thomas Haller
088e606fcc ifcfg-rh: take reference to nm_inotifiy_helper_get() singleton in NMIfcfgConnection
https://bugzilla.redhat.com/show_bug.cgi?id=1253330
2015-08-13 16:18:48 +02:00
Lubomir Rintel
8810036895 device: don't assert the platform device's not there upon creation attempt
It might just be that we didn't see it yet; either on daemon startup on in a
race. The nm_platform_*_add() deals with the device already being there in
_link_add_check_existing().

  NetworkManager:ERROR:devices/nm-device-bridge.c:402:create_and_realize: assertion failed: (nm_device_get_ifindex (device) <= 0)

  Program received signal SIGABRT, Aborted.
  0x00007ffff46965d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
  56        return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
  Missing separate debuginfos, use: debuginfo-install bluez-libs-5.23-4.el7.x86_64
  (gdb) bt
  #0  0x00007ffff46965d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
  #1  0x00007ffff4697cc8 in __GI_abort () at abort.c:90
  #2  0x00007ffff4a916d5 in g_assertion_message (domain=domain@entry=0x5a5088 "NetworkManager", file=file@entry=0x59b0f2 "devices/nm-device-bridge.c", line=line@entry=402, func=func@entry=0x59b3f0 <__FUNCTION__.29169> "create_and_realize", message=message@entry=0xa76a30 "assertion failed: (nm_device_get_ifindex (device) <= 0)") at gtestutils.c:2292
  #3  0x00007ffff4a9176a in g_assertion_message_expr (domain=domain@entry=0x5a5088 "NetworkManager", file=file@entry=0x59b0f2 "devices/nm-device-bridge.c", line=line@entry=402, func=func@entry=0x59b3f0 <__FUNCTION__.29169> "create_and_realize", expr=expr@entry=0x59aef8 "nm_device_get_ifindex (device) <= 0") at gtestutils.c:2307
  #4  0x0000000000447cb6 in create_and_realize (device=0xa77f40 [NMDeviceBridge], connection=0x8d0200, parent=<optimized out>, out_plink=0x7fffffffd700, error=0x0) at devices/nm-device-bridge.c:402
  #5  0x000000000045d560 in nm_device_create_and_realize (self=self@entry=0xa77f40 [NMDeviceBridge], connection=connection@entry=0x8d0200, parent=<optimized out>, error=error@entry=0x0)
  at devices/nm-device.c:1594
  #6  0x00000000004d4b64 in system_create_virtual_device (self=self@entry=0x8802b0 [NMManager], connection=connection@entry=0x8d0200, error=error@entry=0x0) at nm-manager.c:983
  #7  0x00000000004d4d71 in system_create_virtual_devices (self=0x8802b0 [NMManager]) at nm-manager.c:1022
  #8  0x00000000004d47a5 in add_device (self=<optimized out>, device=<optimized out>, try_assume=<optimized out>) at nm-manager.c:1785
  #9  0x00000000004d501f in platform_link_added (self=self@entry=0x8802b0 [NMManager], ifindex=<optimized out>, plink=plink@entry=0xa7f810) at nm-manager.c:1887
  #10 0x00000000004d7c24 in nm_manager_start (self=0x8802b0 [NMManager]) at nm-manager.c:1959
  #11 0x00000000004d7c24 in nm_manager_start (self=self@entry=0x8802b0 [NMManager], error=error@entry=0x7fffffffd930) at nm-manager.c:4178
  #12 0x00000000004459ec in main (argc=1, argv=0x7fffffffda88) at main.c:442
  (gdb)
2015-08-13 10:31:41 +02:00
Thomas Haller
f0bca9ed7b core: merge branch 'th/singleton-cleanup-bgo753519'
Some cleanup for singleton instances and fix some leaks
during shutdown.

https://bugzilla.gnome.org/show_bug.cgi?id=753519
2015-08-13 10:06:50 +02:00
Thomas Haller
3cb1ead3af device: log message when constructing NMDevice instance 2015-08-13 10:06:43 +02:00
Thomas Haller
205bb86ead active-connection: log lifetime of NMActiveConenction 2015-08-13 10:06:43 +02:00
Thomas Haller
97c971b4e4 active-connection: make use of logging macro _LOGD() 2015-08-13 10:06:43 +02:00
Thomas Haller
c6cbd652ba active-connection: add logging macros _LOG*() 2015-08-13 10:06:43 +02:00
Thomas Haller
1928c2f878 core: relax logging message about disowning singletons
It is not uncommon to see first a "disown" message before "disposing".
That alone does not yet indicate anything wrong or a leak. Remove that
overly alarming part of the logging message.
2015-08-13 10:06:42 +02:00
Thomas Haller
13c21baf2e settings: ensure no duplicate plugin instances in load_plugin() 2015-08-13 10:06:42 +02:00
Thomas Haller
8bb6ab558e settings: implement setting plugins via NM_DEFINE_SINGLETON_GETTER()
Advantages:

 - use current best-pratice
 - registers a weak-ref to clear @singleton_instance when the
   instance gets destroyed
 - logs creation and destruction of singleton
 - on shutdown, destroy the singleton instance via
   _nm_singleton_instance_register_destruction(). Note, that
   we now have yet another reference to the singleton that is
   owned by register-destruction.
2015-08-13 10:06:42 +02:00
Thomas Haller
f979124dc9 settings: add other check to ensure no duplicates in load_plugins()
We already avoid loading duplicate plugins by checking find_plugin().
That iterates the plugins @list and checks for duplicate names.
Additionally, also reject duplicates based on the @plugins list.

Also, move the check for "keyfile" before, so that all explicit
checks for (statically) known names are early and together.
2015-08-13 10:06:42 +02:00
Thomas Haller
9558560862 ifcfg-rh: refactor construction of plugin instance and acquiring D-Bus service
Move code from sc_plugin_ifcfg_init() and nm_system_config_factory()
to constructed().
2015-08-13 10:06:42 +02:00
Thomas Haller
68eec304e2 settings: don't leak keyfile plugin instance
We leaked a reference to the keyfile plugin and thus
it was not destructed on shutdown.
2015-08-13 10:06:42 +02:00
Thomas Haller
406b05a31a keyfile: don't have static @singleton in nm_settings_keyfile_plugin_new()
There is no need to have a static @singleton variable.
The only caller of nm_settings_keyfile_plugin_new() is
NMSettings which owns the singleton instance.

A *_new() function should just create a new instance and
that's it. It's unexpected to reuse the same instance.
2015-08-13 10:06:42 +02:00
Thomas Haller
31cde10b69 core: nm_singleton_instance_register() of NMManager instance
Register the singleton instance of NMManager as we do for other
singletons. That way, we get automatic destruction and the singleton
instance get's properly cleared (when the instance gets destroyed).
2015-08-13 10:06:42 +02:00
Thomas Haller
80117aa676 policy: take a reference to the firewall-manager singleton
Singletons that refer to other singletons in their destructor
should own a reference to those other singletons to ensure that
the lifetimes are handle correctly.
2015-08-13 10:06:42 +02:00
Thomas Haller
99ad9fedf5 platform: delay destruction of NMPlatform singleton until NMConfig gets destroyed
We want to create the platform instance rather late (especially after
claiming the D-Bus service). But we also want to destroy it very late,
because NMPlatform does not make use of any other singletons, but
other singletons make use of NMPlatform.
2015-08-13 10:06:42 +02:00
Thomas Haller
67bcaca75e agent-manager: have NMAgentManager own NMSessionMonitor instance
The latter makes use of the former. Ensure that NMSessionMonitor
lives long enough.
2015-08-13 10:06:42 +02:00
Thomas Haller
7168283871 settings: let NMSettingsConnection own reference to nm_session_monitor_get()
This way, the lifetime of the session monitor is guaranteed to exceed
the lifetime of it's user -- the NMSettingsConnection.
2015-08-13 10:06:42 +02:00
Thomas Haller
24d191d06c session-monitor: explicitly use singleton instance
Some functions from nm-session-monitor.c have an implicit access to
nm_session_monitor_get(). This is non-obvious behavior.

Instead require the explicit session-monitor instance to be
provided -- where needed.
2015-08-13 10:06:42 +02:00
Thomas Haller
ab0e3a223d core/utils: add NM_UTILS_KEEP_ALIVE() utility 2015-08-13 10:06:42 +02:00
Thomas Haller
b9f00dbb19 manager: remove WiMAX rfkill flag from NMManger
WiMAX support was dropped in commit 721e917cb6.
Also, remove support for the WiMAX rfkill flag and only preserve the
D-Bus property for backward compatibility.
2015-08-13 10:06:42 +02:00
Jiří Klimeš
bccc1af51b 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
2015-08-13 09:48:12 +02:00
Lubomir Rintel
b339d4e5d6 device-factory: allow using nm_device_factory_manager_for_each_factory() before load
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)
2015-08-12 18:18:56 +02:00