Commit Graph

386 Commits

Author SHA1 Message Date
Dan Williams
701c05ad69 build: remove spurious comma from configure.ac 2016-01-20 12:21:40 -06:00
Lubomir Rintel
83d043b112 release: bump version to 1.1.90 (1.2-beta1) 2016-01-19 14:45:36 +01:00
Michael Biebl
39fc73eed9 build: use symlinks for nmtui
Make /usr/bin/nmtui-* symbolic links to /usr/bin/nmtui.

https://bugzilla.gnome.org/show_bug.cgi?id=759824
2016-01-07 17:41:53 +01:00
Thomas Haller
db80ec05ab build: rename directory "include" to "shared"
Up to now, the "include" directory contained (only) header files that were
used project-wide by libs, core, clients, et al.

Since the directory now also contains a non-header file, the "include"
name is misleading. Instead of adding yet another directory that is
project-wide, with non-header-only content, rename the "include"
directory to "shared".
2015-12-24 11:42:37 +01:00
Lubomir Rintel
7873b1761d build: bump soup requirement to 2.40
The dns-manager uses some newer API.
2015-12-10 19:17:56 +01:00
Lubomir Rintel
15f1cd09d9 build: use soup 2.32
We already use 2.32 API and also use API that was replaced with new one after
2.42 and deprecated in 2.53.
2015-12-10 18:53:49 +01:00
Thomas Haller
14bb9419a0 examples: add README for python-networkmanager NetworkManager library 2015-12-07 16:06:46 +01:00
Thomas Haller
d5a8401686 initscript: remove all distribution initscripts
These initscripts weren't modified for a long time. Are they just
unused or flawless? It seems they are no longer best-practice
(e.g. NetworkManager supports reloading configuration via SIGHUP,
which none of these scripts implement).

Nowadays some distributions moved to systemd and quite possible
nobody uses these scripts. Also, any potential downstream user
probably has an adjusted copy of them in their repositories.

Just remove them.

https://mail.gnome.org/archives/networkmanager-list/2015-December/msg00003.html
2015-12-07 13:37:30 +01:00
Lubomir Rintel
90683fcb3a build: substitute config directory in Makefile
The autoconf substitutions should be expanded in Makefiles and shell scripts
only, does not work well in XML.

Fixes: 3e0b590e10
2015-11-27 14:18:34 +01:00
Lubomir Rintel
3e0b590e10 build: Remove NM_CONFIG_KEYFILE_PATH_DEFAULT from config.h
Can't just substitute sysconfdir into a header file -- it's meant to be
expanded in a Makefile. Otherwise, unexpanded ${prefix} will end up in a
header file.

We do that for NMCONFDIR already, let's use it here too.

Fixes: 2144457fab
2015-11-27 10:04:10 +01:00
Thomas Haller
4dacf0b1ad nmtst/valgrind: allow calling 'run-test-valgrind.sh' script directly
When you want to run valgrind for a test, you either had to
invoke valgrind manually, or doing it via `make check` (provided
you configured --with-valgrind).

Make it more convenient to run valgrind by passing the test
to run to the "run-test-valgrind.sh" wrapper.

This also allows to pass -p/-s to the test, which is not possible
during `make check` because selecting tests conflicts with "--tap".
The following invocations are largely equivalent and work as
expected:

  $ ./tools/run-test-valgrind.sh ./src/platform/tests/test-link-linux -p /link/software/detect/vlan

  $ NMTST_DEBUG=no-debug,p=/link/software/detect/vlan ./tools/run-test-valgrind.sh ./src/platform/tests/test-link-linux
2015-11-24 11:02:55 +01:00
Joel Holdsworth
8051038b4d build/nmcli: make nmcli build optional
https://mail.gnome.org/archives/networkmanager-list/2015-November/msg00043.html
https://mail.gnome.org/archives/networkmanager-list/2015-November/msg00063.html
2015-11-19 13:51:59 +01:00
Beniamino Galvani
ff31171a1c lldp: add test case
Add a test for the LLDP listener to ensure that things don't
accidentally break when we import new code from systemd upstream.

https://bugzilla.gnome.org/show_bug.cgi?id=757005
2015-11-10 14:25:05 +01:00
Thomas Haller
b4cf41f9e7 build: no longer link against libnl-route-3 library 2015-11-02 13:57:02 +01:00
Thomas Haller
9ecdba316c platform: create netlink messages directly without libnl-route-3
Instead of using libnl-route-3 library to serialize netlink messages,
construct the netlink messages ourselves.

This has several advantages:

- Creating the netlink message ourself is actually more straight
  forward then having an intermediate layer between NM and the kernel.
  Now it is immediately clear, how a platform request translates to
  a netlink/kernel request.
  You can look at the kernel sources how a certain netlink attribute
  behaves, and then it's immediately clear how to set that (and vice
  versa).

- Older libnl versions might have bugs or missing features for which
  we needed to workaround (often by offering a reduced/broken/untested
  functionality). Now we can get rid or workaround like _nl_has_capability(),
  check_support_libnl_extended_ifa_flags(), HAVE_LIBNL_INET6_TOKEN.
  Another example is a libnl bug when setting vlan ingress map which
  isn't even yet fixed in libnl upstream.

- We no longer need libnl-route-3 at all and can drop that runtime
  requirement, saving some 400k.
  Constructing the messages ourselves also gives better performance
  because we don't have to create the intermediate libnl object.

- In the future we will add more link-type support which is easier
  to support by basing directly on the plain kernel/netlink API,
  instead of requiring also libnl3 to expose this functionality.
  E.g. adding macvtap support: we already parsed macvtap properties
  ourselves because of missing libnl support. To *add* macvtap
  support, we also would have to do it ourself (or extend libnl).
2015-11-02 13:57:01 +01:00
Thomas Haller
4a20956400 platform: parse netlink messages ourselves without libnl-route-3
Constructing the libnl3 object only to parse the message
is wasteful. It involves several memory allocations, thread
synchronization and parsing fields that we don't care about.

But moreover, older libnl version might not support all the
fields we are interested in, hence we have workarounds like
_nl_link_parse_info_data(). Certain features might not fully
work unless libnl supports it too (although kernel would).

As we already parse the data ourselves sometimes, just go
all they way and don't construct the intermediate libnl object.

This will allow us to drop the _nl_link_parse_info_data() workarounds
in next commits. That is important, because _nl_link_parse_info_data()
sidesteps our platform cache and is not in sync with the cache (not to
mention the extra work to explicitly refetch the data on every lookup).

Also, it gets us 60% on the way to no longer needing 'libnl-route-3.so'
at all and eventually drop requiring the library.
2015-11-01 17:28:08 +01:00
Thomas Haller
7e2710fcd0 build: no longer link against libnl-genl-3 library 2015-11-01 17:28:07 +01:00
Lubomir Rintel
a07f1000ba dns-unbound: use the correct path when calling dnssec-trigger-script
Debian systems don't have /usr/libexec, so the script is installed in
a different path.

Based on a patch from Arto Jantunen <viiru@debian.org>
2015-10-30 11:15:51 +01:00
Thomas Haller
2144457fab keyfile: make the keyfile location configurable
https://bugzilla.gnome.org/show_bug.cgi?id=755995
2015-10-14 20:23:38 +02:00
Beniamino Galvani
90fb64024c merge: merge branch 'systemd' into master 2015-10-08 14:14:19 +02:00
Thomas Haller
6395c829bb build: make NM_MORE_ASSERTS define numeric for different levels of more-asserts
Allows to enable more-asserts more granularly.

Unfortunately, the old check was "${enable_more_asserts} == "yes", thus
we cannot extend "--enable-more-assert=level" because that would mean
that the same build script cannot set the option on both old and new
NetworkManager.
Thus, add a new option --with-more-asserts=level. If you put the
following in your build script, it will work as expected whether
you build a new or an old version of NetworkManager.
  ./configure --enable-more-asserts --with-more-asserts=5
2015-10-05 15:25:54 +02:00
Thomas Haller
7bf10a75db build: extract version macros from "nm-version.h" to new header file "nm-version-macros.h"
For libnm library, "nm-dbus-interface.h" contains defines like the D-Bus
paths of NetworkManager. It is desirable to have this header usable without
having a dependency on "glib.h", for example for a QT application. For that,
commit c0852964a8 removed that dependancy.

For libnm-glib library, the analog to "nm-dbus-interface.h" is
"NetworkManager.h", and the same applies there. Commit
159e827a72 removed that include.
However, that broke build on PackageKit [1] which expected to get the
version macros by including "NetworkManager.h". So at least for libnm-glib,
we need to preserve old behavior so that a user including
"NetworkManager.h" gets the version macros, but not "glib.h".

Extract the version macros to a new header file "nm-version-macros.h".
This header doesn't include "glib.h" and can be included from
"NetworkManager.h". This gives as previous behavior and a glib-free
include.

For libnm we still don't include "nm-version-macros.h" to "nm-dbus-interface.h".
Very few users will actually need the version macros, but not using
libnm.
Users that use libnm, should just include (libnm's) "NetworkManager.h" to
get all headers.
As a special case, a user who doesn't want to use glib/libnm, but still
needs both "nm-dbus-interface.h" and "nm-version-macros.h", can include
them both separately.

[1] https://github.com/hughsie/PackageKit/issues/85

Fixes: 4545a7fe96
2015-09-30 23:10:29 +02:00
Jiří Klimeš
94bbe7465f supplicant: adjust fragment_size according to MTU (bgo #755145)
NetworkManager set wpa_supplicant's fragment_size option to 1300. But if MTU
was lower, wpa_supplicant failed with "l2_packet_send - sendto: Message too
long" due to fragmentation of EAP-TLS or EAP-PEAP packets.

Actually, MTU has to be 14 bytes bigger than the "fragment_size" parameter.

Ideally, wpa_supplicant would take MTU in the account and adjust the
fragmentation limit accordingly. See discussion in
http://lists.shmoo.com/pipermail/hostap/2015-August/033546.html

https://bugzilla.gnome.org/show_bug.cgi?id=755145
2015-09-23 12:41:11 +02:00
Lubomir Rintel
4fb5879c44 build: avoid premature expanding
We want ${prefix} unexpanded in a .pc files and the rest expands just fine in
Makefiles.
2015-08-21 10:53:16 +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
Quentin Glidic
a6e3a60844 configure.ac: do not hardcode pkg-config
Always use $PKG_CONFIG instead

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>

https://bugzilla.gnome.org/show_bug.cgi?id=753502
2015-08-11 13:42:31 +02:00
Dan Winship
753e81d21f build: make libnm-util/libnm-glib optional
Add --without-libnm-glib, for people who don't want to build the
legacy client libraries. When building with this option, dbus-glib and
libdbus are not required.
2015-08-10 09:41:26 -04:00
Dan Winship
1cf35cb26b core: final gdbus porting
Port remaining bits to gdbus and remove stray dbus-glib references

Drop the dbus-glib version check from configure, since nothing depends
on new dbus-glib any more.

Move nm-dbus-glib-types.h and nm-gvaluearray-compat.h from include/ to
libnm-util/ since they are now only used by libnm-util and libnm-glib.
2015-08-10 09:41:26 -04:00
Eric Koegel
0db81e1014 sleep-monitor: add support for ConsoleKit2 inhibit
ConsoleKit2 has added the same suspend/resume DBUS API that Systemd
uses. This patch adds the code to use ConsoleKit2's inhibit API.
http://consolekit2.github.io/ConsoleKit2/#Manager.Inhibit

[thaller@redhat.com: modified original patch]

https://bugzilla.gnome.org/show_bug.cgi?id=752836
2015-08-07 11:45:57 +02:00
Thomas Haller
d7ca945a9f build: print configure result for default configuration values in a common format 2015-08-04 14:16:23 +02:00
Thomas Haller
98cd83e578 build: fix configure bug for detecting libaudit support
Fixes: c4c0bbb28c
2015-08-04 14:15:27 +02:00
Thomas Haller
c4c0bbb28c audit-manager: enable logging.audit by default when libaudit support is available
Previously, when compiling NetworkManager with libaudit support, it
was disabled by default and only used after setting logging.audit=true.

Turn that around. If we compile NetworkManager with audit support, we also
enable it by default. The user can then explicitly disable it by
configuring logging.audit in NetworkManager.conf.

But also, add a configure option 'yes-disabled-by-default' to compile
with audit support, but have it disabled by default. This would be the
previous behavior, but it must be enabled explicitly.

Fixes: be49a59fb6
2015-08-04 13:44:55 +02:00
Beniamino Galvani
be49a59fb6 core: add audit support
Introduce some primitives to deliver messages about relevant
configuration changes to the Linux audit subsystem through libaudit
(if enabled at build time) and to the logging system.
2015-08-04 09:32:12 +02:00
Beniamino Galvani
4fb0d62802 build: remove SELinux AM_CONDITIONAL from configure.ac 2015-08-04 08:46:11 +02:00
Beniamino Galvani
6b967e51aa build: remove unneeded AC_SUBST macros after PKG_CHECK_MODULES
The PKG_CHECK_MODULES macro shipped with modern versions (at least
0.24) of pkg-config already calls AC_SUBST to generate ${PKG}_CFLAGS
and ${PKG}_LIBS variables in Makefiles.

Remove the unneeded occurrences of AC_SUBST after PKG_CHECK_MODULES in
configure.ac; this should be safe because we are already assuming that
pkg-config version is recent enough in some other places.
2015-08-04 08:46:11 +02:00
Dan Winship
3452ee2a0e all: rename nm-glib-compat.h to nm-glib.h, use everywhere
Rather than randomly including one or more of <glib.h>,
<glib-object.h>, and <gio/gio.h> everywhere (and forgetting to include
"nm-glib-compat.h" most of the time), rename nm-glib-compat.h to
nm-glib.h, include <gio/gio.h> from there, and then change all .c
files in NM to include "nm-glib.h" rather than including the glib
headers directly.

(Public headers files still have to include the real glib headers,
since nm-glib.h isn't installed...)

Also, remove glib includes from header files that are already
including a base object header file (which must itself already include
the glib headers).
2015-07-24 13:25:47 -04:00
Lubomir Rintel
924117c144 build: fix comment for NM_MORE_LOGGING
Reported-by: Michael Biebl <biebl@debian.org>
2015-07-15 11:03:35 +02:00
Thomas Haller
f7581bbedc logging: add compile time default for logging.backend configuration 2015-07-14 15:55:14 +02:00
Thomas Haller
cd5417ff4f build: detect systemd-journald support 2015-07-14 15:52:50 +02:00
Thomas Haller
74818b155c build: fix $nmlibdir to be "/usr/lib/NetworkManager"
Was detected as "/usr/lib64/NetworkManager".

Fixes: 32dbc51dbd
2015-07-02 18:46:37 +02:00
Thomas Haller
6f0036151f settings: enable "ibft" plugin by default together with "ifcfg-rh"
Originally, ibft settings were handled by "ifcfg-rh" plugin. Later, we added
a separate "ibft" plugin and moved the functionality there.

The problem was that users quite possibly had a configuration like
  [main]
  plugins=ifcfg-rh
in their "NetworkManager.conf". That meant, after upgrade users would
no longer have ibft support.

We fixed that by installing "/etc/NetworkManager/conf.d/10-ibft-plugin.conf"
which was read after the main file and contained:
  [main]
  plugins+=ibft

We no longer want to install configuration snippets with our core packages to
/etc. Avoid the regression by changing the meaning of "ifcfg-rh". By enabling
"ifcfg-rh" you now implicitly enable "ibft" plugin as well. This can be
turned off via "no-ibft". And you can continue to enable "ibft" plugin
alone.
2015-07-02 16:01:20 +02:00
Thomas Haller
32dbc51dbd build: add nmlibdir define 2015-07-02 16:01:20 +02:00
Thomas Haller
e700211f00 settings/example: remove 'example' settings plugin
The 'example' settings plugin is (obviously) unused, but it is also
badly maintained and no longer best-practice in several ways:

  - it directly reads "NetworkManager.conf" instead of using NMConfig.
  - it parses device specs itself, instead of using
    nm_match_spec_split().
  - read_connections() doesn't ensure that loading a file
    does not replace a previously loaded one (due to conflicting
    UUID). In general the example doesn't show/handle the complexity
    of potential UUID conflicts.

Instead of fixing these issues it is better to ensure our main plugin
('keyfile') corresponds to current best practices. Should we ever add a
new pluginww, 'keyfile' should be the example.
2015-06-12 15:59:40 +02:00
Beniamino Galvani
4739ff6e7c settings: remove ifcfg-suse plugin
After the hostname functionality has been moved from plugins to core,
the ifcfg-suse plugin contains only boilerplate code with no actual
functionality.

Remove the plugin, mark it as deprecated in manual page and print a
warning when it is selected in configuration file.
2015-06-12 15:59:39 +02:00
Beniamino Galvani
6c3d71c431 core: move handling of hostname from plugins to core
How to write and read the machine hostname is something that has been
handled until now by plugins; this is questionable since the method
using for storing the hostname should depend only on the distro used
and not on which plugins are enabled.

This commit moves all hostname-related functions from plugins to the
core and allows to specify the method used to load and store the
hostname at build time with the

  --with-hostname-persist=default|suse|gentoo

configure option.

'default' method stores the hostname to /etc/hostname and monitors it
to detect runtime changes.

When the selected method is 'suse', the hostname gets read from and
written to /etc/HOSTNAME; the file /etc/sysconfig/network/dhcp is also
read to detect if the hostname is dynamic and thus invalid. Both files
are monitored for changes.

'gentoo' method relies on /etc/conf.d/hostname for storing the
hostname.
2015-06-12 15:59:39 +02:00
Lubomir Rintel
e486a3803d build: don't abort configure if there's no systemd devel headers
Just disable systemd-logind session tracking instead.
2015-06-02 12:30:03 +02:00
Lubomir Rintel
c47c06470a builds: only enable TAP driver for glib >= 2.37.6
No TAP support for previous versions and --tap argument is silently ignored,
confusing the TAP driver.
2015-05-28 12:51:24 +02:00
Pavel Šimerda
cd3c52a24d build: support runstatedir configure option
https://bugzilla.gnome.org/show_bug.cgi?id=737139

[thaller@redhat.com: modified original patch]
2015-05-28 11:46:11 +02:00
Dan Williams
6baca260d1 Partially revert "dhcp: gracefully recover from failed DHCP BOUND state transitions (bgo #743700)"
This reverts commit 7daf63461de4195b1626ca15f835fc7cbc56e847.

Turns out the removal of the second set of [] in configure.ac causes the command
to be wrong in 'configure' and the test to be incorrect.
2015-05-26 18:23:26 -05:00
Lubomir Rintel
6463ce5dd9 tests: use the TAP formatter
The test results in standard format are easily integrated into CI systems.
2015-05-26 13:51:45 +02:00