Commit graph

15117 commits

Author SHA1 Message Date
Thomas Haller
d43a0459bc merge: merge branch systemd into master 2016-05-31 11:46:27 +02:00
Thomas Haller
3fd08cdce5 systemd: update code from upstream
This is a direct dump from systemd git on 2016-05-31, git commit
b76e4ebe1065ba56ab02b2356bf7680f54846aca.

======

SYSTEMD_DIR=../systemd
COMMIT=b76e4ebe1065ba56ab02b2356bf7680f54846aca

(
  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/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-05-31 11:10:30 +02:00
Beniamino Galvani
0dc999d80e libnm-core: fix comparison of team configuration
NMSettingTeam implements a custom compare_property() method in order
to perform a relaxed matching on team configurations when it is
necessary to assume a connection. However, the method is called also
when the core needs to check if a connection has changed before an
update. In that case it is better to use the default string comparison
on the property, otherwise the second of these commands would not have
effect:

 $ nmcli connection modify team0 team.config ''
 $ nmcli connection modify team0 team.config '{ }'

because compare_property() returns TRUE. Use the @flags argument to
distinguish the two cases.

Fixes: 82f8a54854
2016-05-31 10:59:43 +02:00
Beniamino Galvani
a2f5ba8e06 dhcp/dhclient: emit a warning if the DHCPv6 hostname is not a FQDN
RFC 4704 ("The DHCPv6 Client FQDN Option") allows both partial and
fully-qualified names in the FQDN option, however dhclient always
appends a terminating zero-length label to the name, so we ignore
unqualified hostnames to prevent a wrong configuration.

Emit a warning when the field is ignored so that users can clearly see
why the hostname is not being sent.
2016-05-31 10:49:46 +02:00
Beniamino Galvani
f97ffea82e libnm: export nm_setting_ip6_config_get_token() symbol
Fixes: 954d937b2f
2016-05-30 18:27:21 +02:00
Thomas Haller
63571b2666 device: reconfigure IP addressing after bringing up device
For changing the hardware address, we must bring the device down. When doing
that, IP addressing is lost and it must be re-configured after bringing the
device up again.

We already do something similar in device_link_changed(), but that might
not be sufficient, because device_link_changed() is run on an idle
handler, thus, while changing the hardware address it has no chance to
run (or notice that the device was shortly down).

https://bugzilla.redhat.com/show_bug.cgi?id=1309899
2016-05-30 18:11:55 +02:00
Lubomir Rintel
2edaf35f12 merge: branch 'lr/connection-token'
https://bugzilla.gnome.org/show_bug.cgi?id=765851
2016-05-30 16:40:41 +02:00
Thomas Haller
6fd1bf0749 device: accept failure to lookup link in get_ip_iface_identifier()
An assertion seems a bit harsh, especially, because the platform
cache cannot be always in sync with the device state.
2016-05-30 16:32:07 +02:00
Thomas Haller
6732e2a18b device: lookup platform data only once in get_ip_iface_identifier()
No need to perform multiple cache lookups.
2016-05-30 16:32:07 +02:00
Lubomir Rintel
9133dec2d9 device: set the iid to rdisc from connection's property
...as opposed to directly from the platform. If the token was set in
platform, it was picked up when generating a connection anyway.
2016-05-30 16:32:07 +02:00
Lubomir Rintel
6c018a283b device: use the token set in platform when generating a connection 2016-05-30 16:32:07 +02:00
Lubomir Rintel
60e2a3ea76 platform: add capability to set the tokenized interface identifier
We don't need the token set in platform for our address mode generation,
but having it set makes it possible to correctly generate and assume
connections that use tokens.
2016-05-30 16:32:07 +02:00
Lubomir Rintel
0bd51b41c3 cli: add ipv6.token support 2016-05-30 16:32:07 +02:00
Lubomir Rintel
954d937b2f setting-ip6-config: add token property 2016-05-30 16:32:06 +02:00
Lubomir Rintel
24f428f768 platform: use utility functionality to stringify link 2016-05-30 16:32:06 +02:00
Thomas Haller
e88f5a6c23 platform: remove nm_platform_link_get_ipv6_token()
No need for the extra cache lookup.
2016-05-30 16:32:06 +02:00
Thomas Haller
e5f63f2a50 platform: remove unnecessary NMPlatformLink.inet6_token.is_valid field
The only user of platform who accesses this field is NMDevice,
when calling nm_platform_link_get_ipv6_token(). It cares more
about whether the token is all-zero or set to something.

Another use of inet6_token.is_valid was so that when we receive a
netlink message without IFLA_INET6_TOKEN attribute, that we don't
treat the value as zero, although it is just unknown. Fix that
instead in a better way by setting the value from the cache, if
IFLA_AF_SPEC doesn't provide it.

Also, when printing the token in nm_platform_link_to_string()
treat it as an IPv6 address (inet_ntop).
2016-05-30 16:19:20 +02:00
Lubomir Rintel
0c40bce314 core-utils: add conversions of ipv6 tokens
From/to strings and interface identifiers.
2016-05-30 16:19:20 +02:00
Lubomir Rintel
76ee40cb58 linux: use the utility functionality to convert the token from platform 2016-05-30 16:14:04 +02:00
Lubomir Rintel
d4831d3417 ifcfg-rh: drop IPV6_ADDR_GEN_MODE=stable-privacy when the mode is eui64 2016-05-30 16:14:04 +02:00
Lubomir Rintel
02f935c4cc all: fix the identfier typo 2016-05-30 16:14:04 +02:00
Lubomir Rintel
db771044cb libnm-util: a trivial typo 2016-05-30 16:14:04 +02:00
Lubomir Rintel
e96f0e6349 all: trivial: use g_value_dup_string () 2016-05-30 16:13:48 +02:00
Beniamino Galvani
28938155e0 core: don't include dns-priority in IP configuration hash
The DNS priority property of a IP configuration determines how the
configuration compares to others when deciding their order, but
doesn't specify directly parameters to be applied. In other words, two
configurations which differs only for the dns-priority should have the
same hash as applying them will give the same result.

Especially, when the DNS manager computes the hash of IP
configurations, the ones without real configuration data (servers,
domans, options...) should not change the hash value.

Thus, exclude the property from the hash computation and dowgrade any
modification to 'minor change'.

Fixes: bfabfb05ae
Fixes: f09f5e1ec8
2016-05-30 14:37:22 +02:00
Thomas Haller
04852d2877 dhcp: log setting and clearing systemd dhcp client instance
internal systemd code produces logging messages by itself, like
  libsystemd: DHCP CLIENT (0x9204b5ce): ACK

Let's log the pointer value initially, to associate the logged "xid"
with the pointer value of the client.

Now we get:

  <trace> [1464520695.7655] dhcp4 (enp0s25): dhcp-client4: set 0x556cdd9d6800
  <debug> [1464520695.7658] libsystemd: DHCP CLIENT (0x9d87b7c5): STARTED on ifindex 2
2016-05-29 13:33:07 +02:00
Beniamino Galvani
4feb58b50b dns: clear dnsmasq cache after an update
When the list of DNS servers changes, old DNS entries cached by
dnsmasq must be invalidated as the answers returned by new servers may
be different (especially, old NXDOMAIN entries may now be valid). Call
the dnsmasq "ClearCache" D-Bus method to achieve this.

https://bugzilla.redhat.com/show_bug.cgi?id=1338731
2016-05-28 09:34:15 +02:00
Beniamino Galvani
d376787ce1 dns/dnsmasq: cancel pending update on dispose
There might be a pending "SetServersEx" D-Bus call when the plugin is
destroyed, ensure it gets canceled.
2016-05-28 09:34:12 +02:00
Thomas Haller
9ab1682b5e core: merge branch 'th/vpn-connection-dns-fix'
nm-libreswan VPN has no own IP interface. Thus we got an
assertion failure in nm_dns_manager_add_ip_config().

Fix that, by using the IP interface of the parent device.
2016-05-27 18:04:05 +02:00
Thomas Haller
3f8a60def6 vpn,dns: for interface-less VPN connections get the ip_iface from the parent device
Since 027f4c65ac, the ip_iface for
nm_dns_manager_add_ip_config() must be set.

Wit interface-less VPN types like libreswan, we thus hit the assertion
  nm_dns_manager_add_ip_config: assertion 'iface && iface[0]' failed

Fix that, by fallback to the interface name of the parent device.

Fixes: 027f4c65ac
2016-05-27 12:54:55 +02:00
Thomas Haller
18501d7b68 vpn-connection: add @fallback_device argument to nm_vpn_connection_get_ip_iface()
and nm_vpn_connection_get_ip_ifindex(). For VPN types that have no own
IP interface, we often want instead lookup the IP interface from the
parent device.
2016-05-27 12:54:55 +02:00
Thomas Haller
5357b1874e vpn-connection: ensure ip_iface and ip_ifindex are set together
ip_iface and ip_ifindex come as a pair. They must be either set both, or not
at all. Ensure that whenever setting one, the other is set too (or cleared).
2016-05-27 12:27:59 +02:00
Beniamino Galvani
0c80e38f64 dns/dnsmasq: use servers without split DNS if no domain was received
When a VPN server doesn't push any DNS domain, we want to use the
received servers for all queries.

https://bugzilla.gnome.org/show_bug.cgi?id=766769
2016-05-26 09:47:43 +02:00
Beniamino Galvani
3c649e6429 team: expose current device configuration through D-Bus and nmcli
Add a new "Config" property to the D-Bus interface for team devices
and show its value through "nmcli device show". The property contains
the full JSON configuration from teamd for the device.

https://bugzilla.redhat.com/show_bug.cgi?id=1310435
2016-05-26 09:16:46 +02:00
Cosimo Cecchi
3df3e46d64 nm-device-wifi: add TURBONETT to no-roaming WiFi networks
TURBONETT is the default network name of a very popular internet
provider in Guatemala, so roaming should be disabled.

https://bugzilla.gnome.org/show_bug.cgi?id=766845
2016-05-25 22:42:54 +02:00
Beniamino Galvani
52819b7c94 device: fix NM_DEVICE_GET_PRIVATE() macro
Fixes: adbba0fb39
2016-05-25 17:29:18 +02:00
Thomas Haller
791cbd0817 platform: handle missing netlink attribute IFLA_ADDRESS by cache-lookup
Sometimes the netlink event lacks the IFLA_ADDRESS attribute with
the MAC address of the link. In this case, take the value from
the cached link instance. A missing netlink attribute should have the
meaning of reusing the previous value, not clearing the address.
2016-05-25 15:11:47 +02:00
Thomas Haller
9cf1dbcaef logging,vpn: merge branch 'th/vpn-plugin-debug-bgo766816'
https://bugzilla.gnome.org/show_bug.cgi?id=766816
2016-05-24 22:43:30 +02:00
Thomas Haller
acbdc30f90 logging: print debug messages with syslog level LOG_DEBUG 2016-05-24 21:53:27 +02:00
Thomas Haller
dacf496a2b vpn: set environment for VPN plugin to configure logging
Introduce two environment variables to configure logging
for the VPN plugins:

-  NM_VPN_LOG_LEVEL: when set, a syslog logging level (0-7).

-  NM_VPN_LOG_SYSLOG: either 0 or 1, whether the plugin should
      log to stdout or syslog. Basically, if NetworkManager itself
      runs in the forground, we also want that the plugin logs
      to stdout.
2016-05-24 21:53:27 +02:00
Thomas Haller
7f3ea16533 logging: add new logging domain LOGD_VPN_PLUGIN
This logging domain will be used to enable debugging of the VPN plugins.

However, the plugins might expose sensitive data in this mode, so exclude
the new domain from "LOGD_ALL".
2016-05-24 19:39:30 +02:00
Thomas Haller
a0130e4128 logging: add nm_logging_syslog_enabled() function
We want to know, whether running in debug-mode (logging to stdout)
or whether we log to syslog.
2016-05-24 19:39:30 +02:00
Thomas Haller
13101f8444 logging: add nm_logging_get_level() function 2016-05-24 19:39:25 +02:00
Thomas Haller
4c7fbcc941 device: replace static zero_hwaddr by nm_ip_addr_zero.addr_eth
Instead of defining multiple all-zero-ethernet-address variables, use
nm_ip_addr_zero.addr_eth.
2016-05-24 16:01:59 +02:00
Thomas Haller
82f2fbf78d platform: reuse nm_ip_addr_zero for a all-zero ethernet MAC address 2016-05-24 16:01:59 +02:00
Thomas Haller
a4a75b638f platform: refactor comparing for all-zero,all-ones MAC address in nmp_utils_ethtool_get_permanent_address()
Don't like the static fields.

Also, don't assert against return values from the ethtool call.
And check that the length is positive.
2016-05-24 16:01:59 +02:00
Thomas Haller
d7b4733d3e ifcfg-rh: avoid creating temporary string prefix for svGetValueFull() 2016-05-24 16:01:59 +02:00
Thomas Haller
487dcf7e55 core: merge branch 'th/drop-connection-provider-bgo766560'
https://bugzilla.gnome.org/show_bug.cgi?id=766560
2016-05-24 12:42:21 +02:00
Thomas Haller
5337003c4c core: drop NMConnectionProvider and use NMSettings directly
This is not C# but glib. Using interfaces is so cumbersome, that they
don't simplify code but make it more complicated.

E.g. following signals and its subscribers is complicated enough. It gets
more complicated by having NM_SETTINGS_SIGNAL_CONNECTION_ADDED and
NM_CP_SIGNAL_CONNECTION_ADDED. Of course, your favorite IDE has no idea
about glib interfaces, so figuring out who calls who gets more
complicated.

This undoes commit 4fe48b1273. Originally,
NMConnectionProvider had only one function get_best_connection(). But it
kept growing and more functions were added.

If we want to ~hide~ certain part of the NMSettings API, we should move them
to a separate header which gives internal access.
2016-05-24 12:35:58 +02:00
Thomas Haller
f20341a1fd core: drop interface function nm_connection_provider_get_best_connections()
... in favor of nm_settings_get_best_connections().
2016-05-24 12:35:58 +02:00
Thomas Haller
8e1443457d device: use NMSettings directly instead of NMConnectionProvider in subclasses
Instead of accessing the singleton getter nm_settings_get(), obtain
the settings instance from the device instance itself via
nm_device_get_settings().
2016-05-24 12:35:58 +02:00