Commit Graph

18368 Commits

Author SHA1 Message Date
Lubomir Rintel
323bdc26ea vpn/vpn-connection: log the connection context 2017-03-24 12:42:09 +01:00
Lubomir Rintel
eccad6fa90 settings-connection: log the connection context 2017-03-24 12:42:09 +01:00
Lubomir Rintel
35d7c93405 active-connection: log the connection context 2017-03-24 12:42:09 +01:00
Lubomir Rintel
e6a3e4a06d wwan/modem-broadband: log the connection context 2017-03-24 12:42:09 +01:00
Lubomir Rintel
8da65ac5cd supplicant: log the device context 2017-03-24 12:42:09 +01:00
Lubomir Rintel
c307163b77 ndisc: log the device context 2017-03-24 12:42:09 +01:00
Lubomir Rintel
bc8d4c0366 dhcp: log the device context 2017-03-24 12:42:09 +01:00
Lubomir Rintel
096ab79070 devices/lldp: log the device context 2017-03-24 12:42:09 +01:00
Lubomir Rintel
0f5cf595a0 devices/arping-manager: log the device context 2017-03-24 12:42:09 +01:00
Lubomir Rintel
a30f327b74 devices: log the device context 2017-03-24 12:42:09 +01:00
Lubomir Rintel
ed552c732c logging: log device and connection along with the message 2017-03-24 12:42:09 +01:00
Lubomir Rintel
03a3fd9014 logging: respect choice of journal/syslog even with --debug
Previously, the daemon would just use syslog with LOG_PERROR when run with
--debug option, even when actually configured to log into the journal.
Let's respect the configuration, but preserve the logging to stderr.
2017-03-24 12:42:09 +01:00
Thomas Haller
b11b603879 libnm: handle errors gracefully in nm_access_point_connection_valid()
Suppress warnings and avoid assertions in
nm_access_point_connection_valid().

https://bugzilla.gnome.org/show_bug.cgi?id=773675
2017-03-24 12:08:03 +01:00
Lubomir Rintel
7750a384a5 libnm-util/vapi: add missing dependencies
Works by dumb luck for in-tree build, because the .deps files that are
meant for the distribution happen to be the builddir. The out-of-tree
builds would generate an empty file.
2017-03-24 11:38:49 +01:00
Lubomir Rintel
ec17f82960 build: yet another missing dependency 2017-03-24 11:38:49 +01:00
Thomas Haller
0a34ae55a2 core/trivial: rename nm_utils_10pow() to nm_utils_exp10()
nm_utils_exp10() is a better name, because it reminds of the function
exp10() from <math.h> which has a similar purpose (but whose argument
is double, not gint16).
2017-03-24 11:28:57 +01:00
Thomas Haller
29a47f40f8 build: configure explicit paths for dist tarball during "build_clean.sh"
"build_clean.sh" is used to generate a distribution tarball. The tarball
contains pregenerated man pages with default values for paths, which in
turn depend on the configure options when creating the tarball.

Previously, the man page would have paths like "usr/local/etc/NetworkManager/...",
which doesn't seem the best choice for a default man page.

Explicitly set the installation paths.

Also, --disable-dependency-tracking in this mode. It may speed up the
build.
2017-03-24 11:20:00 +01:00
Thomas Haller
8b9dfa013d build: fix building clients/cli/settings-docs.c (4)
We also dist libnm/nm-property-docs.xml, so depending on
whether we build from git or source tarball, the file
is in $(srcdir) or $(builddir).

Fixes: d7ad13591b
2017-03-24 10:48:56 +01:00
Thomas Haller
051c8917f4 man: fix default location for keyfile.path in documentation
Fixes: 530af7009e
Fixes: 90683fcb3a
2017-03-24 10:40:52 +01:00
Thomas Haller
5581d91973 build: fix building clients/cli/settings-docs.c (3)
Fixes: d7ad13591b
2017-03-24 10:31:15 +01:00
Thomas Haller
431493827b build: fix building clients/cli/settings-docs.c (2)
Fixes: d7ad13591b
2017-03-23 23:23:47 +01:00
Thomas Haller
3468a54ec1 build: fix building clients/cli/settings-docs.c
Fixes: d7ad13591b
2017-03-23 20:57:28 +01:00
Thomas Haller
0fefcbfb2d build: don't link against libm.so
There are very few places where we actually use floating point
or #include <math.h>.

Drop that library, although we very likely still get it as indirect
dependency (e.g. on my system it is still dragged in by libsystemd.so,
libudev.so and libnl-3.so).
2017-03-23 19:06:02 +01:00
Thomas Haller
25654cfa31 core: add nm_utils_10pow() utils 2017-03-23 19:06:02 +01:00
Thomas Haller
d628ada05a build: remove currently unneeded include of shared/nm-setting-metadata.h from nmcli
One day, I wish we would have more setting metadata in shared via
"shared/nm-setting-metadata.h", ready for nmcli and nmtui to use
(by statically linking against the internal API).

Anyway, it is still unused, so drop the files from the SOURCES of
nmcli.
2017-03-23 18:58:47 +01:00
Thomas Haller
d7ad13591b build: fix out-of-tree build for including "clients/cli/settings-docs.c"
"$(srcdir)/clients/cli/settings.c" includes "$(builddir)/clients/cli/settings-docs.c",
hence, we need "-I$(builddir)/clients/cli".

This basically reverts commit bbce089840,
but adds dependencies so that the build directory exists.
2017-03-23 18:50:34 +01:00
Thomas Haller
e4c0a4d0f2 shared: minor change to NM_FLAGS_HAS() and nm_utils_is_power_of_two() macros
NM_FLAGS_HAS() should reject negative flag values. So check for > 0.
Also change parentheses and line wrap.
2017-03-23 18:04:13 +01:00
Lubomir Rintel
b3f6bf3daf release: bump version to 1.7.2 (development) 2017-03-23 17:41:04 +01:00
Lubomir Rintel
da32a9f8bd NEWS: update for a development snapshot 2017-03-23 17:41:04 +01:00
Lubomir Rintel
bbce089840 cli/build: drop $builddir/cli/ from the include path
The sources should reach files in the $builddir using #include "".
Besides, it is not guarranteed to be around:

    CC       shared/clients_cli_nmcli-nm-setting-metadata.o
  cc1: error: ./clients/cli: No such file or directory [-Werror=missing-include-dirs]
  cc1: all warnings being treated as errors
  Makefile:12971: recipe for target 'shared/clients_cli_nmcli-nm-setting-metadata.o' failed
2017-03-23 17:41:04 +01:00
Lubomir Rintel
96571ec621 build: ensure libnm-core is around before mkenums puts files there
It's not sufficient to make nm-core-enum-types.[ch] depend on the
dirstamp, because they also depend on their own stamps that are to be
placed in libnm-core.

  $ make libnm-core/nm-core-enum-types.h.stamp
    GEN      libnm-core/nm-core-enum-types.h
  /bin/sh: libnm-core/nm-core-enum-types.h.tmp: No such file or directory
  ../../Makefile.glib:107: recipe for target 'libnm-core/nm-core-enum-types.h.stamp' failed
  make: *** [libnm-core/nm-core-enum-types.h.stamp] Error 1
2017-03-23 17:41:04 +01:00
Beniamino Galvani
e832461c0e ifcfg-rh: fix coding style 2017-03-23 17:19:21 +01:00
Francesco Giudici
3ebe71cf06 dns: avoid cleaning resolv.conf on exit if not needed
When rc-manager=file other services may overwrite resolv.conf at any
time. We don't support merging configurations in resolv.conf but we can
be more tolerant avoiding updating resolv.conf when not strictly needed.
In this case, if the last write of resolv.conf had no nameservers (nor
options), reset the "dns_touched" flag in order to avoid resetting
resolv.conf when quitting (so, potentially overwriting some other
service configuration there).

https://bugzilla.redhat.com/show_bug.cgi?id=1426748
2017-03-23 17:05:19 +01:00
Iain Lane
6a77258f4e nm-manager: Use g_dbus_message_new_method_error_literal()
GLib 2.52 added a G_GNUC_PRINTF attribute to
g_dbus_message_new_method_error(). This triggered warning in
NetworkManager when built with -Wformat, which is an error when built
with -Werror=format-security. It seems that gcc isn't smart enough to
see that (foo = "bar") should be treated as a literal.

Fortunately there is a g_dbus_message_new_method_error_literal()
function which does not take printf-style arguments, and we don't need
them, so we can use that.

This patch was originally by Rico Tzschichholz <ricotz@ubuntu.com>, and
was submitted to Launchpad at

https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1650972
https://bugzilla.gnome.org/show_bug.cgi?id=780444
2017-03-23 13:11:15 +01:00
Thomas Haller
9e4f3655f0 connectivity: remove verbose trace logging 2017-03-23 12:08:05 +01:00
Thomas Haller
8ddc3e308c platform: remove debug logging messages from "nmp-object.c" 2017-03-23 11:55:34 +01:00
Thomas Haller
3ac07f381e connectivity: fix clearing timer-id in curl_timeout_cb()
Fixes: 7307dea9c4
2017-03-22 21:00:24 +01:00
Lubomir Rintel
08cc81d450 connectivity: fix the connectivity check timeout
CURLOPT_CONNECTTIMEOUT or CURLOPT_TIMEOUT only make sense if libcurl is
handling the I/O loop (the "easy" interface); we need to implement our
own timeout.
2017-03-22 19:06:41 +00:00
Lubomir Rintel
d7e470b0aa connectivity: conclude the check as soon as we see enough bytes
No need to read the full response into memory.
2017-03-22 18:52:56 +00:00
Lubomir Rintel
ac0f454cfb connectivity: conclude the check as soon as we see the magic header
No need to read the rest of the reponse.
2017-03-22 18:52:56 +00:00
Lubomir Rintel
71b8d16eb8 connectivity: split out the finish of the connectivity checking
Factor out the conclusion of the connectivity check. This will allow us
to finish the connectivity check on other occassions than a successful
connection end. Most importantly on timeouts; but it will also allow us
to short-circuit the check when we conclude it without reading the full
response.
2017-03-22 18:52:56 +00:00
Lubomir Rintel
6bc3ada0ec connectivity: cosmetic fixes 2017-03-22 18:52:50 +00:00
Lubomir Rintel
faad17f9e8 contrib/rpm: enable libpsl on Fedora only 2017-03-22 13:01:23 +01:00
Thomas Haller
9faba2cf96 udev: merge branch 'th/gudev-bgo780308'
https://bugzilla.gnome.org/show_bug.cgi?id=780308
2017-03-22 12:52:40 +01:00
Thomas Haller
6808bf8195 udev: add and use nm_udev_utils_property_decode() function
DRY.
2017-03-22 12:41:06 +01:00
Thomas Haller
c7ccdf5fc8 libnm/udev: cache and reuse udev instance for NMDevice
No need to create a separate NMUdevClient instance for all devices.
Instead, have one "struct udev" instance in NMClient and pass
it down during object construction.
2017-03-22 12:41:06 +01:00
Thomas Haller
c48c13b8e5 udev: only create monitor in NMUdevClient when needed
GUdevClient always creates a monitor instance, even if there are no subsystems
or handlers defined. Hence the first iteration of NMUdevClient did that as
well.

I think that can be avoided however. We only need a monitor when there is
a event handler subscribed. Contrary to GUdevClient, we know that from the
very beginning.
2017-03-22 12:41:06 +01:00
Thomas Haller
e32839838e udev: drop libgudev in favor of libudev
libgudev is just a wrapper around libudev. We can
use libudev directly and drop the dependency for
libgudev.
2017-03-22 12:41:06 +01:00
Lubomir Rintel
edaa7d064e merge: branch 'lr/rp-filter'
https://bugzilla.gnome.org/show_bug.cgi?id=780155
2017-03-22 12:21:56 +01:00
Lubomir Rintel
cae3cef60f device: apply a loose IPv4 rp_filter when it would interfere with multihoming
The IPv4 Strict Reverse Path Forwarding filter (RFC 3704) drops legitimate
traffic when the same route is present on multiple interfaces, which is a
pretty common scenario for IPv4 hosts. In particular, if the traffic is
routable via multiple interfaces it drops traffic incoming via the device that
has lower metric on the route to the originating network.

Among other things, this disrupts existing connection when the user connected
to the Internet via Wi-Fi activates a Wired Ethernet connection that also has a
default route. Also, the Strict filter (and Reverse Path filters in general)
provide practically no value to hosts that have a default route.

The solution this patch uses is to detect scenarios where Strict filter is
known to interfere and switch to a saner RP filter on the affected links.
Routes to the same network on multiple interfaces is a good indication the RP
filter would drop the legitimate traffice from the link with a lower metric.
This includes the default routes.

In such cases, we switch to the Loose Reverse Path Forwarding. This addresses
the problems the multihomed hosts face, at the cost of disabling filtering
altogether when a default route is present. A Feasible Path Reverse Path
Forwarding would address the main problems with the Strict filter, but it's
not implemented by the Linux kernel.
2017-03-22 12:21:39 +01:00