Commit graph

16689 commits

Author SHA1 Message Date
Lubomir Rintel
f0e3dfdace active-connection: drop off the bus when the settings connection disappears
The active connection has an immutable connection property, but is
cleaned asynchronously by the manager after its settings connection is
done. Fine, let's remove it from the bus first though, so that we don't
hang there with a dangling object path.
2017-01-24 14:00:59 +01:00
Thomas Haller
9fff9f501a core: drop duplicate code searching for match in nm_match_spec_device()
When searching for "*", we still need to check for higher priority
"except:" matches. But don't duplicate the search loop and just
proceed with the regular searched.

It already has the "if (!except && match == NM_MATCH_SPEC_MATCH)" which
short-cuts the search.
2017-01-23 09:43:24 +01:00
Thomas Haller
0d6885cfa3 systemd: merge branch systemd into master 2017-01-22 15:07:32 +01:00
Jiří Klimeš
1cee85f556 cli: fix some TAB completions for nmcli -a con add 2017-01-21 21:15:26 +01:00
Thomas Haller
c655355752 systemd: update code from upstream
This is a direct dump from systemd git on 2017-01-21, git commit
2feb1c9659f8f9d873615b0c28217a659bdbc86a.

======

SYSTEMD_DIR=../systemd
COMMIT=2feb1c9659f8f9d873615b0c28217a659bdbc86a

(
  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/ether-addr-util.c"
nm_copy_sd "src/basic/ether-addr-util.h"
nm_copy_sd "src/basic/extract-word.c"
nm_copy_sd "src/basic/extract-word.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/signal-util.h"
nm_copy_sd "src/basic/siphash24.c"
nm_copy_sd "src/basic/siphash24.h"
nm_copy_sd "src/basic/socket-util.c"
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-internal.h"
nm_copy_sd "src/libsystemd-network/lldp-neighbor.c"
nm_copy_sd "src/libsystemd-network/lldp-neighbor.h"
nm_copy_sd "src/libsystemd-network/lldp-network.c"
nm_copy_sd "src/libsystemd-network/lldp-network.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-event/sd-event.c"
nm_copy_sd "src/libsystemd/sd-id128/id128-util.c"
nm_copy_sd "src/libsystemd/sd-id128/id128-util.h"
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"
2017-01-21 20:13:46 +01:00
Thomas Haller
b0aaff86b6 core: refactor nm_match_spec_device() to use match-data structure
Instead of passing on invdividual arguments for the match, create
a MatchDeviceData structure and pass it on.

This reduces the number of arguments and extending it later should
be easier. Also, lazily parse the hardware address as needed.
2017-01-21 20:01:29 +01:00
Jiří Klimeš
418733f2c1 cli: move code around to group related functions - no functional change
* all getter/setter/describe, ... functions grouped according to properties
* sort the settings groups alphabetically
2017-01-21 19:50:52 +01:00
Jiří Klimeš
5f90f48467 cli: simplify property functions for allowed values with a macro
DEFINE_ALLOWED_FOR_ENUMS
2017-01-21 19:50:52 +01:00
Jiří Klimeš
6573c2d860 cli: TAB-completion for macsec.mode in interactive editor 2017-01-21 19:50:52 +01:00
Jiří Klimeš
4d8800c876 cli: TAB-completion for ipv6.addr-gen-mode in interactive editor 2017-01-21 19:50:52 +01:00
Thomas Haller
38bb499140 core: merge branch 'th/match-spec-device-refactor' 2017-01-20 21:09:37 +01:00
Thomas Haller
b0e58a9823 src/tests: randomize device spec list for test 2017-01-20 21:05:58 +01:00
Thomas Haller
7b84c73331 shared/tests: add nmtst_rand_perm_gslist() helper 2017-01-20 21:05:58 +01:00
Thomas Haller
b957403efd core: refactor evaluation of device's match-spec
Previously, we would have different functions like
  - nm_match_spec_device_type()
  - nm_match_spec_hwaddr()
  - nm_match_spec_s390_subchannels()
  - nm_match_spec_interface_name()
which all would handle one type of match-spec.

So, to get the overall result whether the arguments
match or not, nm_device_spec_match_list() had to stich
them together and iterate the list multiple times.

Refactor the code to have one nm_match_spec_device()
function that gets all relevant paramters.

The upside is:

  - the logic how to evaluate the match-spec is all at one place
    (match_device_eval()) instead of spread over multiple
    functions.

  - It requires iterating the list at most twice. Twice, because
    we do a fast pre-search for "*".

One downside could be, that we have to pass all 4 arguments
for the evaluation, even if the might no be needed. That is,
because "nm-core-utils.c" shall be independend from NMDevice, it
cannot receive a device instance to get the parameters as needed.
As we would add new match-types, the argument list would grow.
However, all arguments are cached and fetching them from the
device's private data is very cheap.
2017-01-20 20:59:14 +01:00
Beniamino Galvani
7dde8d8106 vlan: use parent interface mtu as default
After commit 22e8af6242 ("device: set a per-device default MTU on
activation") we explicitly set the VLAN MTU to 1500 if not overridden
by user settings. This has the advantage that the MTU is set to a
predictable value, while before it could have different values
depending on when the interface was created (for example, the
interface would get a 1500 MTU if created during boot, or would
inherit the parent's MTU if activated manually).

However, a better default value is the MTU of the parent interface
which is in most cases what the user wants. This value was the default
before commit 22e8af6242 for manually activated connections.

https://bugzilla.redhat.com/show_bug.cgi?id=1414186
2017-01-20 18:35:01 +01:00
Beniamino Galvani
8134d72f49 build: libnm-wwan.so depends on linker script 2017-01-20 17:41:57 +01:00
Beniamino Galvani
714b18dcf7 device: don't call _commit_mtu() when ipv4.method=disabled
After commit 553717bb1c ("device: don't set ip4_state=IP_FAIL for
ipv4.method=disabled"), we commit an empty IPv4 configuration when
IPv4 is disabled. This means that it's not necessary anymore to call
_commit_mtu() because the MTU will be set in
ip4_config_merge_and_apply().
2017-01-20 17:41:48 +01:00
Thomas Haller
ba47744997 device: mark properties in set_property() as construct-only 2017-01-20 17:33:44 +01:00
Thomas Haller
59f37f31d9 device: remove duplicate setting of device's driver property
Fixes: 4dbaac4ba2
2017-01-20 17:10:54 +01:00
Thomas Haller
b85b8ed6fa contrib/rpm: let NetworkManager-libnm and NetworkManager-glib of differing version conflict
Since commit "c920909 contrib/rpm: put translations in
NetworkManager-libnm and NetworkManager-glib packages", both
subpackages install the same translation files without a direct
dependency between the two packages. Thus, if a user tries
to update only one of the two subpackages, it will fail
during the installation due to conflicting files.

Fix that by having the subpackages conflict (per version).
This way, the conflict is detected before starting the
installation.

https://bugzilla.redhat.com/show_bug.cgi?id=1406454
2017-01-20 17:10:38 +01:00
Lubomir Rintel
af16cd5a92 veth: properly chain up the overridden notify method
Fixes: 992beb4f34
2017-01-20 16:09:05 +01:00
Lubomir Rintel
22722b7732 build: fix build with older gi
Fixes: 6c96aafaa9
2017-01-19 13:36:03 +01:00
Beniamino Galvani
4215c2640a act-request: return empty properties when not activated
We start to track changes to the device's properties only after the
active connection gets activated. It's wrong to return properties
while we don't track their changes as this causes stale objects
references on D-Bus. Let's return DHCP and IP configurations from the
device only when the connection is activated.
2017-01-19 11:41:16 +01:00
Lubomir Rintel
6c96aafaa9 build: make the doc generator find the right libnm.so
At some point gobject-introspection added an API to add a library path
and stopped honoring the LD_LIBRARY_PATH (a bug, according to GI
documentation?).
2017-01-19 11:08:45 +01:00
Thomas Haller
a18eed123b supplicant: merge branch 'th/supplicant-eap-fast-supported' 2017-01-18 18:56:46 +01:00
Thomas Haller
19ceaa1dc9 supplicant: update capabilities before marking manager as running 2017-01-18 18:56:01 +01:00
Thomas Haller
872b9ec5ea supplicant: update whether EAP-FAST is supported for existing supplicant-interface
As the fast-supported flag changes, update the existing supplicant
interfaces with the new information.

Also, by default assume it is supported.
2017-01-18 18:56:01 +01:00
Thomas Haller
66ff601ecf supplicant: fix detection of EAP-FAST
At least with my supplicant, the capability is called
all-upper-case "FAST".

The check used case-insensitive, but that was broken
by a previous change.

Fixes: 9f5f141100
2017-01-18 18:56:01 +01:00
Thomas Haller
d5685c183c release: bump version to 1.7.0 (development)
belatedly...
2017-01-18 18:37:06 +01:00
Lubomir Rintel
a4d61bf299 device: fix build with old glib & more asserts
src/devices/nm-device.c:8319:4: error: invalid use of void expression
2017-01-18 13:32:25 +01:00
Lubomir Rintel
7fec0755c9 libnm/object: lower the severity of the dangling object warning
The user can't do much about it and we can recover. This is a temporary
measure to avoid unnecessarily bothering the user.
2017-01-18 12:40:18 +01:00
Lubomir Rintel
c1bb45c361 build: use different defaults for snapshot builds
Enable stricter compiler checks only for snapshot builds and default to more
tracing and asserting there.
2017-01-18 12:40:18 +01:00
Lubomir Rintel
8647be3717 build: move the --enable-more-warning option from m4/ to configure.ac
It will make it easier to policy the default.
2017-01-18 12:40:18 +01:00
Thomas Haller
cca0ba01e4 build: don't install /etc/dbus-1/system.d/nm-ifcfg-rh.conf when building without ifcfg-rh plugin 2017-01-18 00:10:29 +01:00
Thomas Haller
a5acd0bdc6 tests: fix tests without libjansson support (--enable-json-validation=no) 2017-01-17 23:51:57 +01:00
Piotr Drąg
39455bb99f po: update Polish (pl) translation (bgo #777402)
https://bugzilla.gnome.org/show_bug.cgi?id=777402
2017-01-17 23:03:35 +01:00
Lubomir Rintel
7ce805d49d device: add an initializer
Basically to silence gcc that is not smart enough to understand how does
.initialized and .value relate.

  src/devices/nm-device.c: In function '_commit_mtu':
  src/devices/nm-device.c:6754:15: error: 'ip6_mtu_sysctl.value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     if (ip6_mtu && ip6_mtu != _IP6_MTU_SYS ()) {
                 ^
2017-01-17 16:20:39 +01:00
Lubomir Rintel
ba414491b7 release: bump version to 1.5.3 (1.6-rc1) 2017-01-17 14:50:22 +01:00
Thomas Haller
4100fc1d4d proxy: merge branch 'jk/proxy-fixes'
https://bugzilla.gnome.org/show_bug.cgi?id=777385
2017-01-17 14:27:42 +01:00
Jiří Klimeš
49e1fefc35 ifcfg-rh: add a basic test for Proxy setting 2017-01-17 14:27:31 +01:00
Jiří Klimeš
6397ce1fac cli: enable TAB-completion for proxy properties in interactive editor 2017-01-17 14:27:31 +01:00
Jiří Klimeš
1abee2e0d5 pacrunner: fix a few typos, uniforms spelling of various forms to "pacrunner" 2017-01-17 14:27:31 +01:00
Jiří Klimeš
8ac33b02b3 libnm-core: add ifcfg-rh documentation for proxy settings
PROXY_METHOD
BROWSER_ONLY
PAC_URL
PAC_SCRIPT
2017-01-17 14:27:31 +01:00
Jiří Klimeš
addac21270 libnm-core: adjust the documentation of proxy setting
* fix capitalization of abbreviations and normal words
 * use % for Gtk-Doc values
 * and other adjustmens
2017-01-17 14:27:31 +01:00
Jiří Klimeš
e2c4d4d2c9 libnm-core: (trivial) fix white spaces in proxy setting 2017-01-17 14:27:31 +01:00
Thomas Haller
daf935fb1b contrib/rpm: fix code comment in default "NetworkManager.conf" 2017-01-17 14:26:30 +01:00
Lubomir Rintel
c7b525f83e release: update NEWS
Co-authored-by: Thomas Haller <thaller@redhat.com>
2017-01-17 14:15:37 +01:00
Thomas Haller
be813707f0 device: make the MTU globally configurable via connection-defaults
This allows a user to restore the previous behavior where NetworkManager
would not reconfigure the MTU during device activation, if no MTU is
available (commit "22e8af6 device: set a per-device default MTU on
activation").

Well, not exactly. The previous behavior was to use per-connection
configuration, then DHCP provided value, or finally leave the MTU
unspecified.
Now, we prefer a per-connection configuration, followed by a global
connection default. If "ethernet.mtu=0", the MTU is left unspecified.
In absense of a global connection default, the value from DHCP is used
or finally a per-device-type default. That is effectively 1500 for most
types, except for infiniband where the MTU is still left unspecified.
2017-01-17 13:43:50 +01:00
Jiří Klimeš
215152d0a1 libnm: (trivial): add missing return description in comment block 2017-01-17 10:34:16 +01:00
Lubomir Rintel
40a5e845b8 po: import Zanata translations 2017-01-16 22:14:48 +01:00