Commit Graph

14110 Commits

Author SHA1 Message Date
Thomas Haller
c97f7b54fe nmtst: support shorthand "NMTST_DEBUG=TRACE" to set logging level 2015-11-27 14:22:05 +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
Beniamino Galvani
09072d0d5e ppp-manager: set 'export_on_construction' flag
Instead of reimplementing constructed() just to call
nm_exported_object_export(), use the 'export_on_construction' flag
which does this automatically. This also fixes the following error:

nm_exported_object_export: assertion failed: (priv->_constructed)

Fixes: 8a8ecc46ca
2015-11-26 23:11:29 +01:00
Jiří Klimeš
191f213c49 clients: (trivial) remove unused commented code in nm-vpn-helpers 2015-11-26 11:09:15 +01:00
Jiří Klimeš
b8d6bd1a98 clients: move clients/tui/vpn-helpers.c to clients/common/nm-vpn-helpers.c
The file has not been used up to now. But it is going to be used by both
nmtui and nmcli later.
2015-11-26 11:08:44 +01:00
Beniamino Galvani
d1a776bff9 ip4-config: properly handle gateway in nm_ip4_config_replace()
When @src didn't have a gateway and @dst did, the function left @dst's
gateway set to 0.0.0.0; fix this and unset the gateway in such case.

Fixes: 063677101a
2015-11-26 10:02:35 +01:00
Jiří Klimeš
4a06701e88 cli: add 'strongswan' and 'fortisslvpn' to known VPN types 2015-11-25 17:14:02 +01:00
Jiří Klimeš
579fd36566 cli: improve error messages for 'nmcli device set'
Fixes: 4dffbf8f6a
2015-11-25 16:39:00 +01:00
Jiří Klimeš
72374f4252 wifi: (trivial) remove unused failed_link_count 2015-11-25 15:47:59 +01:00
Jiří Klimeš
542200f539 clients: check errors of polkit_unix_session_new_for_process_sync()
polkit_unix_session_new_for_process_sync() can fail. And calling
polkit_agent_listener_register() with NULL PolkitSubject results in errors.

https://bugzilla.gnome.org/show_bug.cgi?id=758625
2015-11-25 12:08:07 +01:00
Thomas Haller
3d8eb6b1e0 gitignore: ignore ifnet/tests/check_ifnet binary
This file no longer exists on master, but it is annoying when
switching branches.
2015-11-25 11:59:37 +01:00
Beniamino Galvani
123d0ba9b8 merge: branch 'bg/create-sw-devices-bgo749369-tun'
Add support for creating TUN/TAP devices.

https://bugzilla.gnome.org/show_bug.cgi?id=749369
2015-11-25 11:53:37 +01:00
Beniamino Galvani
c223e811f1 nmcli/bash-completion: add completion for 'tun' connection mode 2015-11-25 11:53:04 +01:00
Beniamino Galvani
43badf7cdf libnm-glib: print HW address of generic devices in test tool
This is not particularly useful per se, but allows to check that
generic devices are instantiated properly.
2015-11-25 11:39:57 +01:00
Beniamino Galvani
8ca6e412c1 libnm-glib: add support for TUN devices
Since libnm is the preferred way to interact with NM now, we don't
want to add new device types to libnm-glib.

Make libnm-glib recognize TUN devices as generic ones and modify
NMDeviceGeneric to use the correct D-Bus interface based on the actual
device type.
2015-11-25 11:39:57 +01:00
Beniamino Galvani
33e76cf0e0 libnm-glib: refactor _nm_device_type_for_path()
Refactor nm-device.c to expose a private _nm_device_type_for_path()
function which can be used by subclasses to query the actual device
type. In particular, NMDeviceGeneric will use the result of this
function to figure out which interface to use for the D-Bus proxy.
2015-11-25 11:39:57 +01:00
Beniamino Galvani
877de231b8 device/tun: remove unused property enum FLAGS 2015-11-25 11:39:57 +01:00
Beniamino Galvani
337304f19d libnm: add NMDeviceTun 2015-11-25 11:39:57 +01:00
Beniamino Galvani
9110ad39c5 device/tun: support device creation
Allow the creation of a new TUN/TAP interface when a tun connection is
activated.
2015-11-25 11:39:57 +01:00
Beniamino Galvani
5b22711908 platform: support creation of TUN/TAP devices 2015-11-25 11:39:57 +01:00
Beniamino Galvani
64c6b124d2 cli: add support for tun settings
Add nmcli support for adding and modifying TUN/TAP connections.
2015-11-25 11:39:57 +01:00
Beniamino Galvani
1f30147a7a libnm-core: add NMSettingTun
Add a new NMSettingTun which contains configuration properties for TUN/TAP
interfaces.
2015-11-25 11:39:57 +01:00
Lubomir Rintel
fa96bade79 nm-device: don't try to re-add LL address if the devices is torn down
Fixes: 9f92bb1f63
2015-11-25 11:22:22 +01:00
Thomas Haller
8aab22fe45 core: don't handle SIGUSR1 and SIGUSR2 signals for pre 2.36.0 glib
https://bugzilla.gnome.org/show_bug.cgi?id=758614

Reported-by: Glenn Washburn <development@efficientek.com>
2015-11-25 10:54:18 +01:00
Thomas Haller
4c4b67e515 nm-glib: add nm_glib_check_version() util 2015-11-25 10:54:18 +01:00
Glenn Washburn
7a97d16944 dhcp-helper: call g_type_init() to support pre 2.36.0 glib
https://bugzilla.gnome.org/show_bug.cgi?id=758614

[thaller@redhat.com: original patch modified to use nm_g_type_init()]
2015-11-25 10:15:32 +01:00
Lubomir Rintel
960127422d systemd: add an initializer
Fixes build with exceptions enabled.
2015-11-24 16:31:18 +01:00
Lubomir Rintel
495faa3191 build: add a missing file into dist
Fixes: aa22b2d87f
2015-11-24 16:31:07 +01:00
Lubomir Rintel
c0f59cdb2c po: remove special characters from translations
Makes Zanata unhappy, in the Java way.

  for i in po/*.po; do awk '
    /^"  0 = / { print "\"%s\""; n=1; next; }
    /^"  8 = / { n=0; next }
    { if (!n) print }' $i >x
    mv x $i
  done

Fixes: 3641ddb00a
2015-11-24 15:34:33 +01:00
Jiří Klimeš
847f3b646b cli: make a prompt a translatable string in do_connection_clone()
Fixes: 0c65b28960
2015-11-24 15:22:06 +01:00
Jiří Klimeš
795a3943ea device: use nm_utils_find_helper() to find out ping/ping6 binary (bgo #758566)
https://bugzilla.gnome.org/show_bug.cgi?id=758566
2015-11-24 14:30:01 +01:00
Thomas Haller
e2b9346d71 ifcfg-rh: remove unused selinux.h include from "plugin.c" 2015-11-24 12:20:55 +01:00
Thomas Haller
5276f6896b tests: merge branch 'th/test-run-valgrind' 2015-11-24 11:03:21 +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
Thomas Haller
73cb579108 nmtst: support -p and -s arguments from gtestutils via $NMTST_DEBUG
For tests based on glib's test framework, you can select which tests to
run by passing -p/-s on the command line.

Usually, we want to invoke our tests via `make check` which conveniently
calls valgrind (run-test-valgrind.sh) or spawns a private D-Bus server
(libnm-test-launch.sh, libnm-glib-test-launch.sh). At that point, it is
not directly possible to specify command line arguments for the tests,
which is why it is convenient to specify arguments via $NMTST_DEBUG
environment variable.

Parse "p" and "s" arguments from $NMTST_DEBUG and pass them to g_test_init()
to select which tests to run.

  NMTST_DEBUG=p=/core/general/test_setting_ip4_changed_signal ./libnm-core/tests/test-general

However, there is a problem here: in gtestutils, -p/-s conflicts with --tap,
which is how our Makefile invokes the tests. Thus the new options explicitly
don't work when being called during `make check`. Which makes this much
less useful. I only noticed that afterwards, so still keep the patch
because it might still be convenient during developing tests to set the
environment variable once, and then repeatedly spawn the tests, without
specifying -p/-s.
2015-11-24 09:46:06 +01:00
Thomas Haller
a6a2fd7eef nmtst: pass -m=quick when specifying quick test in $NMTST_DEBUG
When the environment variable indicates that we want to run quick
tests, pass "-m=quick" to g_test_init().
2015-11-24 09:42:05 +01:00
Thomas Haller
c8174f0f9f nmtst: detect whether the test runs as tap test
Same as gtestutils does, look for --tap command line argument.
2015-11-24 09:35:01 +01:00
Thomas Haller
5031fc3c71 nmtst: initialize g_test_init() after parsing NMTST_DEBUG 2015-11-24 09:12:42 +01:00
Beniamino Galvani
9b1d195600 merge: branch 'bg/dhcp-send-fqdn-rh1255507'
https://bugzilla.redhat.com/show_bug.cgi?id=1255507
2015-11-23 22:11:42 +01:00
Beniamino Galvani
c3573ebf2b dhcp4: send FQDN option when ipv4.dhcp-fqdn is set
Modify the 3 DHCP client backends to support the new property.
2015-11-23 22:09:12 +01:00
Beniamino Galvani
cba0f4e3c4 cli: add ipv4.dhcp-fqdn property 2015-11-23 22:09:06 +01:00
Beniamino Galvani
5002342d94 ifcfg-rh: support the DHCP_FQDN variable
Add support for the DHCP_FQDN ifcfg-rh variable which maps to the
ipv4.dhcp-fqdn property.
2015-11-23 22:08:22 +01:00
Beniamino Galvani
cb40194532 libnm-core: add a 'dhcp-fqdn' property to NMSettingIP4Config
The property contains the fully qualified domain name to be sent to
DHCP server using the FQDN option. The property is mutually exclusive
with 'dhcp-hostname'.
2015-11-23 16:31:52 +01:00
Beniamino Galvani
dbbb08eb01 dhcp-manager: strip hostname sent by dhcpcd
The dhclient DHCP backend strips the domain part from the hostname
option sent to server; for consistency among different backends
uniform the dhcpcd client to do the same.
2015-11-23 16:31:08 +01:00
Beniamino Galvani
c09b12240e dhcp-manager: strip hostname sent by internal DHCP client
The dhclient DHCP backend strips the domain part from the hostname
option sent to server; for consistency among different backends
uniform the internal client to do the same.
2015-11-23 16:31:08 +01:00
Beniamino Galvani
aa22b2d87f systemd: merge branch 'systemd' into master 2015-11-23 16:18:10 +01:00
Beniamino Galvani
b8c2fc26c1 dhcp: pass IPv6 link-local address to DHCP client
The DHCP client from new libsystemd-network requires a link-local IPv6
address to be passed to the library; add a new argument to
nm_dhcp_manager_start_ip6() and related functions.
2015-11-23 15:58:17 +01:00
Beniamino Galvani
aa9d0d1467 systemd: update code from upstream
This is a direct dump from systemd git on 2015-11-23, git commit
6098bb0dc31b1c472ab868088d04234352c44b75.

======

SYSTEMD_DIR=../systemd
COMMIT=6098bb0dc31b1c472ab868088d04234352c44b75

(
  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/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/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/lldp-util.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/libsystemd/sd-event/event-util.h"
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"
2015-11-23 11:23:25 +01:00
Thomas Haller
e1ea4b725e main: add argument --print-config to NetworkManager 2015-11-22 13:40:32 +01:00