Commit Graph

15047 Commits

Author SHA1 Message Date
Jiří Klimeš
fc6373bea9 device: add nm-plugin-missing property indicating NM device plugin not available
It is useful for indicating that the device type is supported but the required
plugin is not installed.
2015-04-20 10:00:28 +02:00
Jiří Klimeš
823df334ed cli: better indicate when a Wi-Fi plugin might not be available (rh #1168573)
* print an error message indicating NM Wi-Fi plugin may be missing, for
  nmcli device wifi ifname <dev-name>
  nmcli device wifi connect ifname <dev-name>

* add NM-TYPE to 'nmcli device show' command displaying internal NM device type
  (like NMDeviceWifi, NMDeviceGeneric, ...)

https://bugzilla.redhat.com/show_bug.cgi?id=1168573
2015-04-20 09:52:31 +02:00
Jiří Klimeš
8257940606 core: (trivial) fix spelling in comments 2015-04-20 09:45:57 +02:00
Thomas Haller
ec47b9624e core: merge branch 'th/reduce-info-logging-rh1212196'
https://bugzilla.redhat.com/show_bug.cgi?id=1212196
2015-04-18 21:43:29 +02:00
Thomas Haller
255f30c362 device/logging: downgrade log level of "Activation: Stage x of 5" messages
Only downgrade the <info> levels to <debug>. Leave
warnings unchanged.

https://bugzilla.redhat.com/show_bug.cgi?id=1212196
2015-04-18 21:41:40 +02:00
Thomas Haller
b91b8a035c core/logging: reduce info logging messages for devices
https://bugzilla.redhat.com/show_bug.cgi?id=1212196
2015-04-18 21:41:40 +02:00
Thomas Haller
9983e4eff5 device/logging: log connection UUID when activating connection
It is often hard to understand whether we activate an assumed
connection. Only the UUID is unique.
2015-04-18 21:41:40 +02:00
Thomas Haller
e9b9d9b627 core/logging: adjust log line about loading setting plugins
We have different kinds of plugins (settings, dhcp, dns).
Clearify, that we are about to load "settings" plugins.
2015-04-18 21:41:40 +02:00
Thomas Haller
d8e1d9b469 core/logging: downgrade some <info> loggings to <debug>
These logging statements are compile time dependent and
add little informational value.
2015-04-18 21:41:40 +02:00
Thomas Haller
756b756c2c device: expose nm_device_has_capability() function 2015-04-18 21:41:40 +02:00
Thomas Haller
2117bef864 device: use NMDeviceCapabilities enum for device capabilities 2015-04-18 21:41:40 +02:00
Dan Winship
4bac5afa2b libnm-core: trivial error message fixes 2015-04-17 14:55:42 -04:00
Dan Winship
721e917cb6 wimax: drop WiMAX support (bgo #747846)
Even Fedora is no longer shipping the WiMAX SDK, so it's likely we'll
eventually accidentally break some of the code in src/devices/wimax/
(if we haven't already). Discussion on the list showed a consensus for
dropping support for WiMAX.

So, remove the SDK checks from configure.ac, remove the WiMAX device
plugin and associated manager support, and deprecate all the APIs.

For compatibility reasons, it is still possible to create and save
WiMAX connections, to toggle the software WiMAX rfkill state, and to
change the "WIMAX" log level, although none of these have any effect,
since no NMDeviceWimax will ever be created.

nmcli was only compiling in support for most WiMAX operations when NM
as a whole was built with WiMAX support, so that code has been removed
now as well. (It is still possible to use nmcli to create and edit
WiMAX connections, but those connections will never be activatable.)
2015-04-17 12:42:23 -04:00
Thomas Haller
a858b383c3 systemd: make NetworkManager reloadable via SIGHUP
Since f9e4af2, parts of the configuration can be reloaded
by sending SIGHUP to NetworkManager. Add ExecReload option
to service file to support reloading by sending a signal.

Note that 'man 5 systemd.service' advices to use a blocking
command instead of a sending a signal. Later we should add a
D-Bus method to allow reloading synchronously. For now, this
is better then nothing.

https://mail.gnome.org/archives/networkmanager-list/2015-April/msg00042.html
2015-04-17 18:28:50 +02:00
Thomas Haller
de9848aa66 core: optimize nm_match_spec_s390_subchannels() to return early
No need to parse the subchannels if the spec list is empty.

This isn't actually an issue, because nm_match_spec_s390_subchannels()
was never called with empty spec list.
2015-04-17 14:26:49 +02:00
Thomas Haller
6b0f84bdda config: fix filename order for config-description
The configuration snippets are loaded in alphabetical order.
Fix the printed description to reflect that order. Otherwise,
NM logs at startup:

  <info>  Read config: /etc/NetworkManager/NetworkManager.conf and conf.d: 20-connectivity-fedora.conf, 10-ibft-plugin.conf
2015-04-17 13:30:30 +02:00
Lubomir Rintel
9d3b31e1ae nm-remote-connection: take a reference to self while calling get_settings
(process:6888): GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GDBusProxy'

  Program received signal SIGTRAP, Trace/breakpoint trap.
  g_logv (log_domain=0x3149a3b224 "GLib-GObject", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>, args=args@entry=0x7fffffffda70) at gmessages.c:1046
  1046              g_private_set (&g_log_depth, GUINT_TO_POINTER (depth));
  (gdb) bt
  #0  0x0000003148e50c70 in g_logv (log_domain=0x3149a3b224 "GLib-GObject", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>, args=args@entry=0x7fffffffda70) at gmessages.c:1046
  #1  0x0000003148e50eaf in g_log (log_domain=log_domain@entry=0x3149a3b224 "GLib-GObject", log_level=log_level@entry=G_LOG_LEVEL_WARNING, format=format@entry=0x3149a42690 "invalid unclassed pointer in cast to '%s'") at gmessages.c:1079
  #2  0x0000003149a34171 in g_type_check_instance_cast (type_instance=type_instance@entry=0x6fc530, iface_type=<optimized out>) at gtype.c:4030
  #3  0x00007ffff7d6b016 in nmdbus_settings_connection_call_get_settings_finish (proxy=0x6fc530, out_settings=out_settings@entry=0x7fffffffdbb8, res=res@entry=0x6fe150, error=error@entry=0x0)
      at nmdbus-settings-connection.c:1303
  #4  0x00007ffff7ce8813 in updated_get_settings_cb (proxy=<optimized out>, result=0x6fe150, user_data=user_data@entry=0x6fc650) at nm-remote-connection.c:588
  #5  0x000000314a27640d in g_simple_async_result_complete (simple=0x6fe150 [GSimpleAsyncResult]) at gsimpleasyncresult.c:763
  #6  0x000000314a2df47c in reply_cb (connection=<optimized out>, res=0x6fe0e0, user_data=user_data@entry=0x6fe150) at gdbusproxy.c:2623
  #7  0x000000314a27640d in g_simple_async_result_complete (simple=0x6fe0e0 [GSimpleAsyncResult]) at gsimpleasyncresult.c:763
  #8  0x000000314a2d48cc in g_dbus_connection_call_done (source=<optimized out>, result=<optimized out>, user_data=user_data@entry=0x7fffec01a320) at gdbusconnection.c:5502
  #9  0x000000314a27640d in g_simple_async_result_complete (simple=0x6e5f40 [GSimpleAsyncResult]) at gsimpleasyncresult.c:763
  #10 0x000000314a27647c in complete_in_idle_cb (data=0x6e5f40) at gsimpleasyncresult.c:775
  #11 0x0000003148e49b6b in g_main_context_dispatch (context=0x687970) at gmain.c:3064
  #12 0x0000003148e49b6b in g_main_context_dispatch (context=context@entry=0x687970) at gmain.c:3663
  #13 0x0000003148e49f08 in g_main_context_iterate (context=0x687970, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3734
  #14 0x0000003148e4a232 in g_main_loop_run (loop=0x687a80) at gmain.c:3928
  #15 0x00000000004136a1 in main (argc=<optimized out>, argv=<optimized out>) at nmcli.c:632
  (gdb)
2015-04-17 13:03:03 +02:00
Thomas Haller
b97a45957f valgrind: fix suppressions for glib for Fedora 21 2015-04-17 11:57:26 +02:00
Thomas Haller
40fbb36aad valgrind: add comment to suppressions file 2015-04-17 11:52:45 +02:00
Thomas Haller
36fc5cac83 contrib/rpm: add comment to NetworkManager.conf file
https://mail.gnome.org/archives/networkmanager-list/2015-April/msg00036.html
2015-04-16 18:43:03 +02:00
Thomas Haller
2bb44d91d8 platform/trivial: move ethtool code 2015-04-14 13:06:53 +02:00
Thomas Haller
dffb18cb34 platform/trivial: move udev_detect_link_type_from_device() 2015-04-14 13:06:53 +02:00
Thomas Haller
34d82d0df1 platform: split link_type_from_udev()
Also change link_extract_type() to accept NULL as @platform
argument.
2015-04-14 13:06:53 +02:00
Thomas Haller
d695776d48 platform/trivial: move udev code closer to beginning of nm-linux-platform.c 2015-04-14 13:04:13 +02:00
Thomas Haller
7354dc4c58 platform/trivial: remove unused argument from udev_get_driver() 2015-04-14 13:02:04 +02:00
Jiří Klimeš
8252553615 cli: add PHYS_PORT_ID property to devices
The physical-port-id property was added to libnm (libnm-glib) in commit
47cc8b25f2.
2015-04-14 12:18:00 +02:00
Beniamino Galvani
3e8d828008 wifi: fix memleak in nm_ap_update_from_properties()
Fixes: 59c8192b22
2015-04-13 21:39:21 +02:00
Dan Williams
e165463964 api: add missing device state reason for NewActivation
Fixes: 1ad193a017
2015-04-13 11:30:27 -05:00
Lubomir Rintel
0b9a4cd8df device: merge branch 'lr/veth-no-external-up'
https://bugzilla.gnome.org/show_bug.cgi?id=747465
2015-04-13 13:53:43 +02:00
Lubomir Rintel
bcc79cc0eb device: turn off "unmanaged unless IFF_UP externally" for veth
We currently don't manage a veth inside a container despite we should because
it's an externally configured software interface and thus waits for IFF_UP.

Given veths are prevented from being managed outside of a container by an udev
rule anyway it's safe to lift the external IFF_UP requirement for them.
2015-04-13 13:51:27 +02:00
Lubomir Rintel
adb6e9afb1 device: move the decision whether to wait for IFF_UP a virtual function
We'd like to override it for veths.
2015-04-13 13:51:27 +02:00
Dan Williams
62f40bade0 wifi: use the supplicant's CurrentBSS as the current AP (bgo #747424)
Instead of trying to do a bunch of fragile frequency/SSID/security
matching, just use what the supplicant thinks the current AP is.
2015-04-10 15:59:05 -05:00
Thomas Haller
1eaddced10 make use of NM_MORE_ASSERTS, nm_assert() and NM_MORE_LOGGING 2015-04-10 18:09:32 +02:00
Thomas Haller
63593a19d8 build: add --enable-more-logging configure option
NM core uses nm-logging which is entirely configurable at runtime.
Other components use glib-logging, which can also be partly configured
via G_MESSAGES_DEBUG.

It makes sense to have a compile time option to enable some
logging statements that are only useful for heavy debugging.

For glib-logging, this is a way to enable/disable extra logging.
For nm-logging, we could alternatively configure a least log-level
that is enabled at compile time (that way, we could configure to prune all
LOGL_TRACE logging). While that might be useful (too), this gives
an alternative way to disable/enable logging.

Add a configure option --enable-more-logging and a NM_MORE_LOGGING define
for that.

If we don't find this useful after a while, we can simply remove it,
because our logging statements are not part of a "stable" behavior.
2015-04-10 18:08:09 +02:00
Thomas Haller
08ecafd2bf build: add --enable-more-asserts configure option and nm_assert() macro
NM already has two kinds of assertions:
 - g_assert*(), conditionally compiled via #ifndef G_DISABLE_ASSERT
 - g_return*(), conditionally compiled via #ifndef G_DISABLE_CHECKS

In theory, one should be able to disable both asserts and NM should
still work correctly (and possibly more efficient). In practice,
hardly anybody is testing such a configuration and it might be broken.
Especially, we don't disable asserts for production builds, both because
of less test coverage and because it might reduce our ability to debug.

Add a new configure option --enable-more-asserts, which defines
NM_MORE_ASSERTS and nm_assert(). This is for expensive asserts,
that -- contrary to the asserts above -- are disabled by default.
This is useful for extended debugging.
2015-04-10 18:06:59 +02:00
Thomas Haller
4ab540939c test: print NMTST_SEED_RAND value with g_print()
For tests with assert-logging enabled, we already printed
the message with g_print(), instead of g_message().

We always want to print this value, because it is important
to reproduce a test failure. Hence, just (always) print
directly to stdout.

Also, add a leading newline, because the output was attached
to the previous line.
2015-04-10 18:06:20 +02:00
Dan Williams
fbf60536f9 wifi: fall back to band matching when frequency matching fails
Some dual-band access points use the same BSSID in both the 5GHz
and 2.4GHz bands, so obviously frequency must be taken into account
when matching.  But no AP should ever use the same SSID/BSSID pair
concurrently in the same band on different frequencies.

Some APs also dynamically channel hop when they detect interference,
or when they restart, they do so on a different channel after finding
the channel with the lowest interference.  To assure that we don't
end up with stale scan list entries when the AP has switched to
another channel in the same band, fall back to band matching
when merging new scan results.
2015-04-10 10:17:45 -05:00
Dan Williams
227de48a91 wifi: remove unused AP 'broadcast' property
Nothing ever read the value.
2015-04-10 10:17:45 -05:00
Dan Williams
85aac315c0 wifi: always strict-match access points when merging
The only reason to allow lazy matching was to update a fake
current AP when its real scan result comes in.  Now that NM
tracks the current AP based on the the supplicant's current
BSS, a fake current AP will be replaced when the real scan
result arrives.  So it's pointless to update the fake one
when it'll just be removed soon.
2015-04-10 10:17:45 -05:00
Dan Williams
f191e204ac wifi: trivial whitespace fixup 2015-04-10 10:17:45 -05:00
Dan Williams
0bdee17402 wifi: update AP properties from supplicant signals 2015-04-10 10:17:45 -05:00
Dan Williams
37760fdc83 wifi: use supplicant's CurrentBSS as the current AP
Instead of keeping track of it internally, and attempting to fuzzy-match
access points and stuff, just use the supplicant's information.  If the
supplicant doesn't know what AP it's talking to, then we've got more
problems than just NM code.

The theory here is that when starting activation, we'll use the given
access point from the scan list that the supplicant already knows about.
If there isn't one yet (adhoc, hidden, or AP mode) then we'll create
a fake AP and add it to the scan list.

Once the supplicant has associated to the AP, it'll notify about the
current BSS which we then look up in the scan list, and set
priv->current AP to that.  If for some reason the given AP isn't yet
in our scan list (which often happens for adhoc/AP) then we'll just
live with the fake AP until we get the scan result, which should happen
very soon.

We don't need to do any fuzzy-matching to find the current AP because
it will either always be one the supplicant knows about, or a fake one
that the supplicant doesn't know about that will be replaced soon anyway.
2015-04-10 10:17:44 -05:00
Dan Williams
6b8df2035e wifi: use a hash table to track access points 2015-04-10 10:17:44 -05:00
Dan Williams
6596ceee14 supplicant: ignore NotConnected errors when disconnecting 2015-04-10 10:17:43 -05:00
Dan Williams
3c19ce7616 supplicant: track and expose wpa_supplicant's CurrentBSS property 2015-04-10 10:17:43 -05:00
Thomas Haller
0aca44c857 test: fix compiler warning in g_test_assert_expected_messages_internal()
-Wformat of gcc determines that the string arguments are NULL.

Fixes: 373d09b042
2015-04-10 15:06:23 +02:00
Thomas Haller
7c5d361c66 platform/trivial: rename object_type_from_nl_object() to _nlo_get_object_type()
The function names in linux-platform should get better prefixes
indicating whether they are related to libnl or nm objects.

Add a prefix _nlo_ for functions that operate on libnl objects.
2015-04-09 17:45:59 +02:00
Thomas Haller
850af91f22 platform/trivial: move code around so that libnl related stuff is together
Reorder some functions in nm-platform, so that we first have independent
libnl wrappers/utils, then NMPlatform type definition, and then the
rest.
2015-04-09 17:31:11 +02:00
Thomas Haller
ee64b8585b platform/trivial: add OBJECT_TYPE_MAX enum value 2015-04-09 17:31:11 +02:00
Thomas Haller
4c9a836774 test: make valgrind suppressions file configurable
Add a configure option --with-valgrind-suppressions=path to allow
specifying a different suppressions file.
2015-04-09 17:02:49 +02:00