Commit Graph

15047 Commits

Author SHA1 Message Date
Thomas Haller
53233bb04c bluez: own reference to connection provider in NMBluezDevice 2016-01-27 14:18:38 +01:00
Thomas Haller
94dcffc475 bluez: own reference to connection provider in NMBluezManager 2016-01-27 14:18:38 +01:00
Thomas Haller
7cc54d5bb9 bluez: fix invoking parent dispose() function in NMBluezManager
Fixes: bf5a6ad443
2016-01-27 14:18:38 +01:00
Thomas Haller
858e4bca45 manager: downgrade assertions to g_critical() in manager's singleton getters 2016-01-27 14:18:38 +01:00
Thomas Haller
bb78d14467 contrib/rpm: add comment to NetworkManager.conf about debug logfiles 2016-01-27 14:11:24 +01:00
Thomas Haller
0cccb7b723 man: reorder and rework CONNECTION SECTION in NetworkManager.conf's manual 2016-01-27 13:48:09 +01:00
Thomas Haller
de97003641 man: fix indention of program listings in NetworkManager.conf 2016-01-27 13:14:53 +01:00
Thomas Haller
b51da9b030 man: replace tabs by eight spaces in xml manual pages 2016-01-27 13:12:49 +01:00
Thomas Haller
4eda14451b man: fix typo in NetworkManager.conf 2016-01-27 12:32:07 +01:00
Thomas Haller
0bedc637ed build: add "shared" files to EXTRA_DIST 2016-01-27 11:51:17 +01:00
Dan Williams
0a3a345b71 dns: remove newlines from errors 2016-01-26 11:26:41 -06:00
Dan Williams
af189b3295 dns: clean up error paths in dns-manager
Specifically for resolvconf, if the write succeeded, but the pclose()
failed error would be left NULL and SR_ERROR would be returned, which
caused a crash in nm_dns_manager_end_updates().
2016-01-26 11:25:50 -06:00
Thomas Haller
acc0d79224 systemd: merge branch 'systemd' into master 2016-01-26 17:45:23 +01:00
Thomas Haller
14912429cc systemd: update code from upstream
This is a direct dump from systemd git on 2016-01-26, git commit
3820ed90335211dc208b048f1ff48ae66940ce3b.

======

SYSTEMD_DIR=../systemd
COMMIT=3820ed90335211dc208b048f1ff48ae66940ce3b

(
  cd "$SYSTEMD_DIR"
  git checkout "$COMMIT"
  git reset --hard
  git clean -fdx
)

git ls-files :/src/systemd/src/ | xargs -d '\n' rm -f

nm_copy_sd() {
    mkdir -p "./src/systemd/$(dirname "$1")"
    cp "$SYSTEMD_DIR/$1" "./src/systemd/$1"
}

nm_copy_sd "src/basic/alloc-util.c"
nm_copy_sd "src/basic/alloc-util.h"
nm_copy_sd "src/basic/async.h"
nm_copy_sd "src/basic/escape.c"
nm_copy_sd "src/basic/escape.h"
nm_copy_sd "src/basic/fileio.c"
nm_copy_sd "src/basic/fileio.h"
nm_copy_sd "src/basic/fd-util.c"
nm_copy_sd "src/basic/fd-util.h"
nm_copy_sd "src/basic/fs-util.c"
nm_copy_sd "src/basic/fs-util.h"
nm_copy_sd "src/basic/hash-funcs.c"
nm_copy_sd "src/basic/hash-funcs.h"
nm_copy_sd "src/basic/hashmap.c"
nm_copy_sd "src/basic/hashmap.h"
nm_copy_sd "src/basic/hexdecoct.c"
nm_copy_sd "src/basic/hexdecoct.h"
nm_copy_sd "src/basic/hostname-util.c"
nm_copy_sd "src/basic/hostname-util.h"
nm_copy_sd "src/basic/in-addr-util.c"
nm_copy_sd "src/basic/in-addr-util.h"
nm_copy_sd "src/basic/io-util.c"
nm_copy_sd "src/basic/io-util.h"
nm_copy_sd "src/basic/list.h"
nm_copy_sd "src/basic/log.h"
nm_copy_sd "src/basic/macro.h"
nm_copy_sd "src/basic/mempool.h"
nm_copy_sd "src/basic/mempool.c"
nm_copy_sd "src/basic/parse-util.c"
nm_copy_sd "src/basic/parse-util.h"
nm_copy_sd "src/basic/path-util.c"
nm_copy_sd "src/basic/path-util.h"
nm_copy_sd "src/basic/prioq.h"
nm_copy_sd "src/basic/prioq.c"
nm_copy_sd "src/basic/random-util.c"
nm_copy_sd "src/basic/random-util.h"
nm_copy_sd "src/basic/refcnt.h"
nm_copy_sd "src/basic/set.h"
nm_copy_sd "src/basic/siphash24.c"
nm_copy_sd "src/basic/siphash24.h"
nm_copy_sd "src/basic/socket-util.h"
nm_copy_sd "src/basic/sparse-endian.h"
nm_copy_sd "src/basic/stdio-util.h"
nm_copy_sd "src/basic/string-table.c"
nm_copy_sd "src/basic/string-table.h"
nm_copy_sd "src/basic/string-util.c"
nm_copy_sd "src/basic/string-util.h"
nm_copy_sd "src/basic/strv.c"
nm_copy_sd "src/basic/strv.h"
nm_copy_sd "src/basic/time-util.c"
nm_copy_sd "src/basic/time-util.h"
nm_copy_sd "src/basic/umask-util.h"
nm_copy_sd "src/basic/unaligned.h"
nm_copy_sd "src/basic/utf8.c"
nm_copy_sd "src/basic/utf8.h"
nm_copy_sd "src/basic/util.c"
nm_copy_sd "src/basic/util.h"
nm_copy_sd "src/libsystemd-network/arp-util.c"
nm_copy_sd "src/libsystemd-network/arp-util.h"
nm_copy_sd "src/libsystemd-network/dhcp6-internal.h"
nm_copy_sd "src/libsystemd-network/dhcp6-lease-internal.h"
nm_copy_sd "src/libsystemd-network/dhcp6-network.c"
nm_copy_sd "src/libsystemd-network/dhcp6-option.c"
nm_copy_sd "src/libsystemd-network/dhcp6-protocol.h"
nm_copy_sd "src/libsystemd-network/dhcp-identifier.c"
nm_copy_sd "src/libsystemd-network/dhcp-identifier.h"
nm_copy_sd "src/libsystemd-network/dhcp-internal.h"
nm_copy_sd "src/libsystemd-network/dhcp-lease-internal.h"
nm_copy_sd "src/libsystemd-network/dhcp-network.c"
nm_copy_sd "src/libsystemd-network/dhcp-option.c"
nm_copy_sd "src/libsystemd-network/dhcp-packet.c"
nm_copy_sd "src/libsystemd-network/dhcp-protocol.h"
nm_copy_sd "src/libsystemd-network/lldp.h"
nm_copy_sd "src/libsystemd-network/lldp-internal.h"
nm_copy_sd "src/libsystemd-network/lldp-internal.c"
nm_copy_sd "src/libsystemd-network/lldp-network.h"
nm_copy_sd "src/libsystemd-network/lldp-network.c"
nm_copy_sd "src/libsystemd-network/lldp-port.c"
nm_copy_sd "src/libsystemd-network/lldp-port.h"
nm_copy_sd "src/libsystemd-network/lldp-tlv.c"
nm_copy_sd "src/libsystemd-network/lldp-tlv.h"
nm_copy_sd "src/libsystemd-network/network-internal.c"
nm_copy_sd "src/libsystemd-network/network-internal.h"
nm_copy_sd "src/libsystemd-network/sd-dhcp6-client.c"
nm_copy_sd "src/libsystemd-network/sd-dhcp6-lease.c"
nm_copy_sd "src/libsystemd-network/sd-dhcp-client.c"
nm_copy_sd "src/libsystemd-network/sd-dhcp-lease.c"
nm_copy_sd "src/libsystemd-network/sd-ipv4ll.c"
nm_copy_sd "src/libsystemd-network/sd-ipv4acd.c"
nm_copy_sd "src/libsystemd-network/sd-lldp.c"
nm_copy_sd "src/libsystemd/sd-id128/sd-id128.c"
nm_copy_sd "src/shared/dns-domain.c"
nm_copy_sd "src/shared/dns-domain.h"
nm_copy_sd "src/systemd/_sd-common.h"
nm_copy_sd "src/systemd/sd-dhcp6-client.h"
nm_copy_sd "src/systemd/sd-dhcp6-lease.h"
nm_copy_sd "src/systemd/sd-dhcp-client.h"
nm_copy_sd "src/systemd/sd-dhcp-lease.h"
nm_copy_sd "src/systemd/sd-event.h"
nm_copy_sd "src/systemd/sd-ndisc.h"
nm_copy_sd "src/systemd/sd-id128.h"
nm_copy_sd "src/systemd/sd-ipv4acd.h"
nm_copy_sd "src/systemd/sd-ipv4ll.h"
nm_copy_sd "src/systemd/sd-lldp.h"
2016-01-26 16:48:18 +01:00
Thomas Haller
ea112ed821 dispatcher: adjust logging output for dispatcher events
Previously, we would log messages like:
  #3 'pre-up' [tun0]: new request (1 scripts)

Journald interprets the "#" prefix as a severity level and
highlights them.
2016-01-26 14:10:56 +01:00
Thomas Haller
8029f59e4f libnm-glib: fix another memory leak around update_permissions()
This time in init_async_got_permissions().

Thereby, just use gs_unref_hash and gs_free_error for cleanup.
2016-01-26 12:20:15 +01:00
Thomas Haller
e0601d501a libnm-glib: fix crash due to uninitalized pointer in get_permissions_reply()
If the D-Bus call failed with error, @permissions would stay uninitialized.
2016-01-26 12:04:08 +01:00
Beniamino Galvani
96b11af92d dns: fix generation of global configuration for dnsmasq
Fixes: ae9e82354a
2016-01-25 21:46:11 +01:00
Beniamino Galvani
3eb5037e1f dhcp/systemd: disable callback before stopping the client
Otherwise the call to stop() would generate a new unwanted state
transition.
2016-01-25 17:46:01 +01:00
Beniamino Galvani
37d0833a15 dhcp/systemd: honor timeout 2016-01-25 17:46:01 +01:00
Beniamino Galvani
2ef70653fb dhcp/systemd: gracefully fail when the interface has unknown ARP type 2016-01-25 17:46:01 +01:00
Thomas Haller
583c759dd7 platform: merge branch 'th/platform-recvmsg-enobufs' 2016-01-25 15:49:31 +01:00
Thomas Haller
f00c472ee8 platform: increase netlink socket receive buffer size
When the receive buffer is too small, we easily can hit ENOBUFS during recvmsg()
and need to resync the platform cache. But even worse, we possibly also loose
ACKs for pending netlink requests so that requests seem to fail (although they
might have succeeded).

Avoid that harder by increasing the buffer size to 8MB. This is also
done by networkd:

  be660c371b
2016-01-25 15:48:09 +01:00
Thomas Haller
45df49ebdd platform: improve detecting ENOBUFS for recvmsg() on netlink socket
libnl3 maps different error codes to NLE_NOMEM. Only resync platform cache
when we really experienced a ENOBUFS from recvmsg().
2016-01-25 15:08:32 +01:00
Thomas Haller
4ba999e41e platform: refactor check for error in event_handler_recvmsgs() to switch statement 2016-01-25 15:07:10 +01:00
Thomas Haller
8ab968d4ef platform: fix draining netlink socket on cache resync
Fixes: 809c547b6c
2016-01-25 14:38:35 +01:00
Thomas Haller
66438de577 core: reject existing links when trying to add a link via platform
When we decide to add a new link, we alredy checked that no such link exists
(ignoring race conditions).

It is wrong to accept a EXITS failure when adding the link. There is no guarantee
that the existing link has all the same properties as the one we intend to add.
More importantly, this link was added externally outside of NetworkManager and it
should not be taken over.

Just treat EXISTS as a failure as any other.
2016-01-25 13:35:10 +01:00
Thomas Haller
809c547b6c platform: handle netlink ACKs in event_handler_recvmsgs() during cache-resync
When reading from netlink-socket fails with NLE_NOMEM, messages were
lost. In this case the cache must be resynced and all pending messages
from the socket are rejected via "event_handler_recvmsgs (platform, FALSE)".

In this case, we don't want to handle the received messages as the
cache anyway needs to resync. However, we are still interested in
all queued ACKs that are there.

We are also interested in RTM_NEWADDR messages which we use to detect
kernel support via _support_kernel_extended_ifa_flags_detect().
2016-01-25 13:33:10 +01:00
Thomas Haller
a47b2abeb1 device: merge branch 'lr/default-unmanaged-bgo746566' (part 5)
Merge another early part of 'lr/default-unmanaged-bgo746566'

https://bugzilla.gnome.org/show_bug.cgi?id=746566
2016-01-24 16:12:08 +01:00
Thomas Haller
4ab3fd37f9 device: add _NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST enum
NM_DEVICE_CHECK_CON_AVAILABLE_FOR_USER_REQUEST is a multi-flag value combining all
the hooks that compose a user-request. Add a special value that has no esplicit
meaning except that it ~is~ a user-request.
2016-01-24 16:07:01 +01:00
Thomas Haller
02ec76df5a device: cleanup handling available-connections
For update, don't delete first and add it again. Just do it
in one step.

For recheck, don't delete all connections first to add them
all anew. Instead, check what changes and only emit the changed
signal if there are any actual changes.
2016-01-24 16:07:01 +01:00
Thomas Haller
9b3b94858b device/trivial: rename functions for available-connections 2016-01-24 16:07:01 +01:00
Thomas Haller
ba187e054d core: refactor functions to use NM_UTILS_LOOKUP*()
Also use NM_UTILS_LOOKUP_STR() macro, which can transform
unknown values to their numerical representation using
alloca().
2016-01-24 15:04:36 +01:00
Thomas Haller
6c6ab10dea core/trivial: rename NM_UTILS_STRING_LOOKUP_TABLE* to NM_UTILS_LOOKUP*
Due to using a switch stetement, it is no longer only useful for looking
up strings, and it certainly doesn't use a table anymore.
2016-01-24 14:29:37 +01:00
Thomas Haller
b9df6009ff utils: implement NM_UTILS_STRING_LOOKUP_TABLE_DEFINE() as switch() statement
The compiler will likely optimize a  switch() statement also to a table
lookup, but it also works for negative values and values with large
gaps.
2016-01-24 14:21:14 +01:00
Thomas Haller
3ed2488d74 utils: use NM_UTILS_STRING_LOOKUP_TABLE_ITEM() macro 2016-01-24 14:20:58 +01:00
Thomas Haller
8956ea661c utils: add NM_UTILS_STRING_LOOKUP_TABLE_ITEM() macro 2016-01-24 14:20:57 +01:00
Thomas Haller
0ce83890bf utils: fix out-of-bound access for negative indexes in _NM_UTILS_STRING_LOOKUP_TABLE_DEFINE() 2016-01-24 11:31:15 +01:00
Thomas Haller
9c3187027c systemd: order NetworkManager.serivce after network-pre.target
https://bugzilla.gnome.org/show_bug.cgi?id=761001
2016-01-23 16:54:33 +01:00
Michael Biebl
b72cdb75d8 build: install nm-settings-ifcfg-rh.5 man page conditionally
Only install nm-settings-ifcfg-rh.5 man page if the ifcfg-rh
configuration plugin has been enabled.

But still add them to EXTRA_DIST so that the source tarball
contains the generated man-file, but it isn't installed.

https://bugzilla.gnome.org/show_bug.cgi?id=759823
2016-01-23 16:47:03 +01:00
Thomas Haller
c94a9372fa travis: fix bug in .travis.yml
Fixes: 1408b8c0a2
2016-01-23 16:26:03 +01:00
Beniamino Galvani
0ba500d131 core: merge branch 'bg/iptables-sharing-rules-bgo692673'
Remove iptables rules for connection sharing upon termination to avoid
the presence of duplicate rules when NM is restarted.

https://bugzilla.gnome.org/show_bug.cgi?id=692673
2016-01-23 10:04:26 +01:00
Beniamino Galvani
e3a6ba6756 manager: cleanup active connections upon exit
When connection sharing is enabled, the removal of iptables rules is
delegated to the NMActRequest destructor; but for this to work it is
required that the object is properly dereferenced upon NM termination.

Clean up the active connections which are in DEACTIVATED state when
quitting, so that they are unexported and destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=692673
2016-01-23 10:01:21 +01:00
Beniamino Galvani
8cba3e046e core: list iptables sharing rules in the right order
The rules were added to the list using g_slist_append() and then
applied one at time using "iptables --insert" which puts them at the
beginning of the chain, reversing the initial order.

Instead, list them in the desired order and use g_slist_prepend() to
achieve the same result. This has no functional changes.
2016-01-23 10:01:21 +01:00
Lubomir Rintel
ba24a12739 systemd: add chroot capability
CAP_SYS_CHROOT is needed for openvpn hardening.
2016-01-22 22:12:43 +01:00
Lubomir Rintel
1408b8c0a2 travis: add coverity submission
Also, decouple the build from the test run; it looks better in the .yml file as
well as in the travis UI.
2016-01-22 22:12:43 +01:00
Thomas Haller
dfee5495e8 build: merge branch 'th/tests-dbus-run-session'
Update build script to prefer dbus-run-session over dbus-launch.
2016-01-22 17:03:33 +01:00
Thomas Haller
f74a9000b1 tests: use dbus-run-session for tools/run-test-valgrind.sh 2016-01-22 16:54:32 +01:00
Thomas Haller
fb1da0eab2 tests: allow fallback to dbus-launch in case dbus-run-session is not available
Like on Ubuntu 12.04 which is currently used by our Travic CI setup.
2016-01-22 16:52:42 +01:00
Thomas Haller
5170d3a760 tests: move common dbus test-runners to tools/ directory 2016-01-22 16:52:41 +01:00