Commit graph

8090 commits

Author SHA1 Message Date
Beniamino Galvani
2b958dce91 wwan/ofono: fix indentation 2016-06-28 17:34:42 +02:00
Dan Williams
7d89b862f4 wwan/ofono: remove unused code 2016-06-28 17:34:42 +02:00
Dan Williams
0c9527d9b8 wwan/ofono: fix comment about IP4Config refcounting 2016-06-28 17:34:42 +02:00
Dan Williams
602c3f6ed3 wwan/ofono: clean up and standardize logging 2016-06-28 17:34:42 +02:00
Dan Williams
938b27a8d2 wwan/ofono: simplify capabilities function and add FIXME about LTE 2016-06-28 17:34:42 +02:00
Dan Williams
b898b0882b wwan/ofono: whitespace fixup 2016-06-28 17:34:42 +02:00
Dan Williams
3c054e21ba wwan/ofono: remove some unused types 2016-06-28 17:34:42 +02:00
Dan Williams
87aa671e6b wwan: no need for NM_MODEM_BROADBAND_MODEM to be public 2016-06-28 17:34:42 +02:00
Dan Williams
219904920f wwan/ofono: clean up g_clear_object() usage 2016-06-28 17:34:42 +02:00
Dan Williams
58ab8c9316 wwan/ofono: use g_dbus_proxy_new_for_bus() 2016-06-28 17:34:42 +02:00
Dan Williams
f0af7a0d05 wwan: rework ModemManager/ofono initialization
Avoids the following error when ofono isn't running:

NetworkManager[25133]: <info>  [1466186144.1392] ofono is now available
NetworkManager[25133]: <warn>  [1466186144.1637] failed to enumerate oFono devices: Cannot invoke method; proxy is for a well-known name without an owner and proxy was constructed with the G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag

because the code assumes that if the GDBusProxy is created, that
oFono is available.  That's not the case with DO_NOT_AUTO_START
because it creates the proxy anyway, and lets the caller listen
for name-owner-changed signals instead.  The GDBusProxy also
doesn't need to be cleared, since it will follow name-owner
changes and emit g-name-owner changes when oFono starts/stops.

This also fixes the oFono name-owner-changed watch.  It was presumably
using the signal name copied from the ModemManager 'notify::name-owner'
code, but that's a GDBusObjectManagerClient.  The oFono code is using
a GDBusProxy for which the signal is 'notify::g-name-owner'.

Finally, the oFono code shouldn't really be piggy-backing on the
ModemManager autolaunch code, it's just cleaner to keep the two
code paths separate and initialize oFono in parallel.
2016-06-28 17:34:42 +02:00
Dan Williams
019b34af62 wwan/ofono: whitespace fixup 2016-06-28 17:34:42 +02:00
Dan Williams
8a827b1b4f wwan/ofono: fix a few more memory leaks 2016-06-28 17:34:42 +02:00
Dan Williams
425ae4fbd2 wwan: remove some dbus-glib left-overs 2016-06-28 17:34:42 +02:00
Dan Williams
d99171d700 wwan: use modem basename as NM device name
NM_MODEM_UID is used as the modem device name, and the device name
cannot contain path-like characters.

Ofono has a bluez plugin that detects paired DUN/PAN capable
Bluetooth devices, and these devices are created with a multi-component
object path like "/hfp/org/bluez/hci0/dev_00_26_E2_AB_68_66".
The NM ofono plugin cannot use these paths as NM device names.

Instead, strip off any path components and use the last part
of the object path as the NM device name.
2016-06-28 17:34:42 +02:00
Thomas Haller
e06e1d4691 wwan: cleanup clearing ofono proxy instance 2016-06-28 17:34:42 +02:00
Thomas Haller
521133d456 core: revert asserts to NM_ASSERT_VALID_PATH_COMPONENT() and _get_property_path()
If ofono violates these asserts, then the bug must be fixed somewhere
else, not by silently doing something wrong.
2016-06-28 17:34:42 +02:00
Thomas Haller
5a740d323e wwan: fix memleaks
And use gs_free in ofono_check_name_owner()
2016-06-28 17:34:42 +02:00
Thomas Haller
5cdb2b1520 wwan: cleanup includes 2016-06-28 17:34:42 +02:00
Thomas Haller
3ef0641674 wwan: some minor refactorings 2016-06-28 17:34:42 +02:00
Thomas Haller
4e00e7a15f wwan: remove unused code 2016-06-28 17:34:42 +02:00
Thomas Haller
735bb933f6 wwan: fix building for !WITH_OFONO 2016-06-28 17:34:42 +02:00
Thomas Haller
acac97f818 wwan: fix compilation error about wrong field name 2016-06-28 17:34:42 +02:00
Thomas Haller
9e63ada7e2 wwna: fix compiler error about wrong prototype 2016-06-28 17:34:42 +02:00
Thomas Haller
8621b0aba9 wwan: fix using wrong enum type for flags for g_dbus_proxy_new() 2016-06-28 17:34:42 +02:00
Thomas Haller
1b570723b4 trivial: style issues and indention 2016-06-28 17:34:42 +02:00
Mathieu Trudel-Lapierre
a6e81af87f wwan: add support for using oFono as a modem manager
This patch adds core wwan support for ofono, as used by Ubuntu Touch.

Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>

https://mail.gnome.org/archives/networkmanager-list/2016-June/msg00089.html
2016-06-28 17:34:42 +02:00
Thomas Haller
13b2253df6 wwan: cleanup clearing modem-manager instance 2016-06-28 17:34:42 +02:00
Beniamino Galvani
df48628a48 vpn: don't merge DNS properties into parent device's configuration
DNS properties should not be copied to parent device's configuration
otherwise they will be applied twice, possibly with two different DNS
priorities.
2016-06-28 16:24:28 +02:00
Beniamino Galvani
a5d1db08f8 dns: log DNS servers at TRACE level
Be more verbose at TRACE level and log the DNS servers associated to
configurations. This will help to debug issues like [0].

[0] https://bugzilla.redhat.com/show_bug.cgi?id=1348887
2016-06-28 16:24:28 +02:00
Beniamino Galvani
641e8b00fe vpn: reuse existing ip_config objects when config gets updated
Previously we created a new NMIP[46]Config object to replace the
previous one every time the plugin reported a new IP configuration
through the Ip[46]Config signal, but the old configuration was not
removed from the DNS manager and would become stale.

The interaction with DNS manager is handled by NMPolicy, which only
reacts to changes in connection status, so it's not easy to have the
configuration removed from DNS while keeping the connection state
ACTIVATED.

A cleaner solutions is to avoid creating a new IP configuration object
and reuse the existing one if possible. The side effect is that the
D-Bus path of the object will not change, which seems also positive.

https://bugzilla.redhat.com/show_bug.cgi?id=1348901
2016-06-28 16:24:16 +02:00
Beniamino Galvani
19133b08da vpn: dispatch pre-up scripts only once
If the plugin sends a new configuration when the connection is already
activated the state should not go back to PRE_UP since this causes
dispatcher scripts to run again.
2016-06-28 16:24:16 +02:00
Francesco Giudici
fd4a8a202e bond/trivial: fix typo 2016-06-28 11:47:50 +02:00
Beniamino Galvani
f2d5c8d7f8 tun,vxlan: add the CAP_IS_SOFTWARE capability
Software devices must report the NM_DEVICE_CAP_IS_SOFTWARE capability
in order to be properly activated. Add the flag to NMDeviceTun and
NMDeviceVxlan.

https://bugzilla.gnome.org/show_bug.cgi?id=767846
2016-06-27 13:08:57 +02:00
Tony Espy
899d7e5cb1 wifi: clear WiFi requested_scan if suppl exits
It's possible for wpa_supplicant to exit with an
outstanding requested_scan pending.  This can lead
to a stall condition where scanning no longer occurs.

https://mail.gnome.org/archives/networkmanager-list/2016-June/msg00117.html
2016-06-25 10:32:24 +02:00
Tony Espy
eed8fd2e43 wifi: clear WiFi requested_scan if suppl goes INACTIVE
It's possible for wpa_supplicant to transition to INACTIVE
state with an outstanding requested_scan pending.  This can
lead to a stall condition where scanning no longer occurs.

[thaller@redhat.com: added break statement to avoid fall-through]

https://mail.gnome.org/archives/networkmanager-list/2016-June/msg00116.html
2016-06-25 10:31:38 +02:00
Thomas Haller
66715515dc platform: avoid crash after calling nl_recv() for old libnl3 version
nl_recv() in libnl3 before version 3.2.15 would return dangling pointers
if nl_recv() fails or has nothing to read [1].

Workaround that by explicitly clearing @buf and @creds.

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

[1] 69468517d0
2016-06-24 19:10:03 +02:00
Thomas Haller
171554d073 device: clearify behavior of NM_UNMANAGED_USER_SETTINGS in comment 2016-06-22 14:07:24 +02:00
Beniamino Galvani
072358dad0 team: check return value of g_dbus_connection_call_sync()
The call can fail; in such case assume that an existing teamd died and
our instance will be able to continue.

https://bugzilla.redhat.com/show_bug.cgi?id=1347015
2016-06-21 14:58:55 +02:00
Thomas Haller
bc1014a93d all: replace _nm_utils_string_in_list() with g_strv_contains() 2016-06-17 12:25:33 +02:00
Didier Raboud
f90abce4d5 wwan: check at runtime whether to start ModemManager
This makes NetworkManager use runtime detection to manage the
ModemManager lifecycle when not run by systemd. Under systemd, we expect
the ModemManager service to be started by systemd, under non-systemd, we
use the dbus activation feature to start ModemManager.

[thaller@redhat.com: original patch heavily modified to check for available
 libsystemd library]

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770871
https://mail.gnome.org/archives/networkmanager-list/2016-June/msg00086.html
2016-06-17 12:21:20 +02:00
Dan Williams
16c368b8eb platform: recognize rmnet and ccmni interfaces as WWAN network devices
https://mail.gnome.org/archives/networkmanager-list/2016-June/msg00087.html
2016-06-17 11:08:51 +02:00
Dan Williams
f969193db4 platform/trivial: rename NM_LINK_TYPE_WWAN_ETHERNET to NM_LINK_TYPE_WWAN_NET
Some newer WWAN netdev types are "rawip" which don't bother with
ethernet framing.
2016-06-17 11:00:10 +02:00
Thomas Haller
4143fbde17 logging: enable logging domain VPN_PLUGIN up to level <info>
The logging domain VPN_PLUGIN controlls logging of the VPN plugins.
Especially at verbose levels <debug> and <trace>, the plugins might
reveal sensitive information in the logging.

Thus, this level should not be enabled by a

  $ nmcli logging general level DEBUG domains ALL

It should only be enabled when requested explicitly.

  $ nmcli logging general level DEBUG domains ALL,VPN_PLUGIN:DEBUG

Previously, the special level VPN_PLUGIN was entirely excluded from
ALL and DEFAULT domains and it was entirely disabled by default. That
is however to strict, as it completely silences the VPN plugins by
defult. Now, enable them by default up to level INFO.

VPN plugins should take care that they don't reveal sensitive
information at levels <info> (LOG_NOTICE) and higher (less verbose).
For more verbose levels they may print passwords, but that should
still be avoided as far as possible.
2016-06-17 08:19:44 +02:00
Thomas Haller
4b288136e1 shared: move shared files to subdirectory "shared/nm-utils/"
The "shared" directory contains files that are possibly used by all components
of NetworkManager repository.

Some of these files are even copied as-is to other projects (VPN plugins, nm-applet)
and used there without modification. Move those files to a separate directory.
By moving them to a common directory, it is clearer that they belong
together. Also, you can easier compare the copied versions to their
original via

  $ diff -r ./shared/nm-utils/ /path/to/nm-vpn-plugin/shared/nm-utils/
2016-06-16 10:45:53 +02:00
Thomas Haller
d37945b064 all: use nm_strcmp_p() for sorting strings 2016-06-15 10:32:32 +02:00
Thomas Haller
fa973afa19 tests: add macro NMTST_G_RETURN_MSG for expecting g_return*() failures
A failure to g_return*() by default prints a g_critical() with stringifing the
condition. Add a macro NMTST_G_RETURN_MSG() that reproduces that line to more
accurately match the failure message.
2016-06-09 12:03:39 +02:00
Beniamino Galvani
21bdb82555 platform: tests: skip already used macvtap ifindexes
In old kernel versions the creation of a macvtap can fail if its
ifindex is already used by a macvtap in another namespace, because of
a conflict in sysfs entries generation [1].

Try to detect this situation in platform tests and skip an ifindex if
already in use.

[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=17af2bce88d31e65ed73d638bb752d2e13c66ced
2016-06-07 14:44:30 +02:00
Beniamino Galvani
6c5a5c9f2a dns: remove nm-dns-utils.c and nm-dns-utils.h
The functions in the two files seem to belong to nm-dns-dnsmasq.c as
nobody else is using them.
2016-06-07 11:20:09 +02:00
Beniamino Galvani
ae763642d8 dns: add reverse DNS IPv6 entries to dnsmasq
https://bugzilla.gnome.org/show_bug.cgi?id=767174
2016-06-07 11:20:09 +02:00