Thomas Haller
a8afbb7299
systemd: merge branch systemd into master
2017-01-04 15:55:46 +01:00
Thomas Haller
17820bf42a
systemd: update code from upstream
...
This is a direct dump from systemd git on 2017-01-04, git commit
6a47fd894d601f7e8e88dec4cb35dfb7d7c15eff.
======
SYSTEMD_DIR=../systemd
COMMIT=6a47fd894d601f7e8e88dec4cb35dfb7d7c15eff
(
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-04 15:46:38 +01:00
Thomas Haller
719d4902d8
device: merge branch 'th/device-parent-bgo776719'
...
https://bugzilla.gnome.org/show_bug.cgi?id=776719
2017-01-04 14:18:09 +01:00
Thomas Haller
2a14a1c7bd
device: drop unused hook nm_device_notify_new_device_added()
...
The only implementations were there for tracking the parent device.
That is now donw via nm_device_parent_*(), parent_changed_notify()
and _parent_notify_changed().
2017-01-04 14:18:01 +01:00
Thomas Haller
992beb4f34
device: move tracking of peer device from NMDeviceVeth to NMDevice
2017-01-04 14:18:01 +01:00
Thomas Haller
6df235df74
device: move tracking of parent device from NMDeviceVxlan to NMDevice
2017-01-04 14:18:01 +01:00
Thomas Haller
b8bfdd99af
device: move tracking of parent device from NMDeviceVlan to NMDevice
2017-01-04 14:18:01 +01:00
Thomas Haller
31682f7a3b
device: move tracking of parent device from NMDeviceMacvlan to NMDevice
2017-01-04 14:18:01 +01:00
Thomas Haller
3be1811a7d
device: move tracking of parent device from NMDeviceIPTunnel to NMDevice
2017-01-04 14:18:01 +01:00
Thomas Haller
f703f4bb65
device: track parent device in NMDevice
...
Multiple subclasses have a parent/link interface (NMDeviceIPTunnel,
NMDeviceVlan). Tracking the parent interface properly is midly
complicated to get right. So, instead of repeating it in each
subclass, track it in the parent device.
2017-01-04 14:18:01 +01:00
Thomas Haller
bd09decf16
device: only emit notify::ifindex when the value actually changes
2017-01-04 14:18:01 +01:00
Thomas Haller
78017f1bdc
device: cleanup setting of ip-iface
...
Move the updating/setting of the ip-ifindex/ip-iface to one place.
Properties should be for the most part immutable/read-only, and only
at particular places modified. That way, it's easier to track who
changes a property.
Also, add a logging line with "ip-ifname" prefix.
2017-01-04 14:18:01 +01:00
Thomas Haller
87076d9345
platform: use wrappers for if_nametoindex() and if_indextoname()
2017-01-04 14:18:01 +01:00
Thomas Haller
e8d5a8356c
platform: add wrappers for if_nametoindex() and if_indextoname()
2017-01-04 14:18:01 +01:00
Thomas Haller
d481489804
device: mark _nm_device_log_self_to_device() as unused
2017-01-04 14:18:01 +01:00
Thomas Haller
15d8634b9a
trivial: rename reload_tun_properties() to update_properties()
...
That is what the function is called in other device implementations.
2017-01-04 14:18:01 +01:00
Thomas Haller
0eb4b404f2
device: have realize_start_notify() call link_changed()
...
Most implementations of realize_start_notify() do the same
for link_changed().
Let NMDevice's base implementation of realize_start_notify() call
link_changed() -- which by default does notthing. This allows subclasses
to only overwrite link_changed().
2017-01-04 14:18:01 +01:00
Thomas Haller
0bb84d1b85
device/ethernet: refactor loading s390 subchannels during realize
...
Instead of overwriting constructed(), update the s390 subchannels via
realize_start_notify(). This makes more sense and is also more similar
to what other device implementations do.
2017-01-04 14:18:01 +01:00
Thomas Haller
7e4120860f
device/vlan: update vlan properties when link changes
...
For example, when the parent link is moved to a different netns,
we must update (clear) the vlan's parent.
2017-01-04 14:18:01 +01:00
Thomas Haller
a2dce28fc8
device: do nothing in NMDevice's link_changed() function
...
All implementations of link_changed() chain up to NMDevice's
base implementation. Thus, everybody wants to set the carrier.
Refactor the code to set the carrier outside of link_changed().
2017-01-04 14:18:01 +01:00
Thomas Haller
c2bc2fbac3
device: make @pllink argument in link_changed() function const
2017-01-04 14:18:01 +01:00
Thomas Haller
9473943ef3
wifi: merge refactor tracking of APs
2017-01-04 14:05:38 +01:00
Thomas Haller
d9efe73fed
wifi: fix nm_wifi_ap_get_id() to parse the ID as guint64 from the exported path
2017-01-04 14:05:27 +01:00
Thomas Haller
49ec12bab3
wifi: implement NM_DEVICE_WIFI_ACCESS_POINTS property getter via ap_list_get_sorted_paths()
...
That way, we get the list sorted. Also, it saves several allocations of
temporary variables.
2017-01-04 14:05:27 +01:00
Thomas Haller
7c601ab8ca
wifi: refactor getting sorted AP list
...
Instead of creating a GSList use an array. That way, we save
the allocation and free of an GSList instance. Also, avoid
cloning the export path. It is stable.
2017-01-04 14:05:27 +01:00
Thomas Haller
674f5f24af
dns: fix memleak in _get_config_variant()
...
There are cases where we wouldn't call g_variant_builder_end()
on @strv_builder and @entry_builder.
Fixes: e3c67177ac
2017-01-04 14:05:22 +01:00
Thomas Haller
44ab504cf7
libnm/docs: merge fix for generating API documentation fro enums (bgo#776848)
...
https://bugzilla.gnome.org/show_bug.cgi?id=776848
2017-01-04 09:40:36 +01:00
Thomas Haller
9d2207b46d
libnm: explicitly set enum values in public nm-dbus-interface.h headers
...
Previously, due to a bug in "tools/enums-to-docbook.pl", enum values
without explicit numeric value were wrongly parsed. That is fixed,
but still explicitly set the value in the public header.
2017-01-04 09:33:57 +01:00
Thomas Haller
36ec46e8f8
docs: fix handling enums without explicit numeric value in "tools/enums-to-docbook.pl"
...
Previously, an enum that didn't explicitly specify a numeric value
would wrongly start counting at 1.
E.g.
typedef enum {
MY_VAL,
} Name;
would result in documentation with MY_VAL=1.
https://bugzilla.gnome.org/show_bug.cgi?id=776848
2017-01-04 09:33:50 +01:00
Lubomir Rintel
c5f17a97ea
nm-online: obtain NMClient asynchronously
...
Before:
$ time nm-online
real 0m0.438s
user 0m0.192s
sys 0m0.023s
After:
$ time ./clients/nm-online
real 0m0.096s
user 0m0.060s
sys 0m0.010s
2017-01-04 06:39:07 +01:00
Thomas Haller
f709393ed4
exported-object: merge extending counter for D-Bus paths to 64bit
2017-01-03 16:18:19 +01:00
Thomas Haller
2486dc5c45
exported-object: don't use "/0" for D-Bus paths but start with 1
...
Only use non-negative index values for the D-Bus path. This is purely
cosmetical, as the actual path value should be treated as opaque. Still,
avoid using 0 and start counting at 1.
2017-01-03 15:46:59 +01:00
Thomas Haller
cd1466190e
exported-object: don't clone class_export_path for counter cache
...
It's a static string anyway.
2017-01-03 15:46:10 +01:00
Thomas Haller
8006045d0d
exported-object: make export_path D-Bus counter 64 bit
...
An overflow of the 32 bit guint is possible and rather ugly
because the D-Bus path should be unique and not repeat.
Avoid that by extending the counter to 64 bit.
2017-01-03 15:42:53 +01:00
Thomas Haller
32dd257d31
exported-object: use NM_EXPORT_PATH_NUMBERED() macro
2017-01-03 15:40:17 +01:00
Thomas Haller
20431a4c16
exported-object: add NM_EXPORT_PATH_NUMBERED() macro
2017-01-03 15:38:49 +01:00
Thomas Haller
922cb4ab77
ifcfg-rh: merge branch 'th/ifcfg-shvar-line-bgo776467'
...
https://bugzilla.gnome.org/show_bug.cgi?id=776467
2017-01-02 17:04:01 +01:00
Thomas Haller
ca3cb90fc2
ifcfg-rh: refactor svOpenFile() to use nm_utils_fd_get_contents()
...
Use nm_utils_fd_get_contents() which has precisely all the steps implemented
to read data from a file descriptor.
There is a downside to this: previously you could compile shvar.c without
nm-core-utils.c. Now, the ifcfg implementation gained a dependency
on NM core utils. That would matter if we one day would like to build
shvar.c without core NetworkManager utils (but that is not planned).
2017-01-02 17:00:52 +01:00
Thomas Haller
1bfbe9383f
ifcfg-rh: add assertions for handling lines in "shvar.c"
...
Just assert that the shvarLine instances are in a valid state.
2017-01-02 17:00:52 +01:00
Thomas Haller
de9e78cc50
ifcfg-rh: refactor handling of lines in shvar.c
...
Pre-process each line and parse the key and value.
Thus, keep the key already prepared.
The point is to do the parsing early and keep the
data in a more suitable format in shvarLine.
2017-01-02 17:00:51 +01:00
Thomas Haller
a6a39af8ca
ifcfg-rh: refactor searching and replacing shvarLine in svhar.c
...
The shlist_delete*() are now named wrong, as they don't delete
the list entry. Anyway, they have only one caller, it's clearer
to inline them.
This way, during svSetValue() we need to iterate the entire
list only once.
2017-01-01 22:16:44 +01:00
Thomas Haller
207a663948
shared: add nm_str_skip_leading_spaces() macro
2016-12-25 15:38:00 +01:00
Beniamino Galvani
8adbeb821e
manager: better handle failures in AddAndActivateConnection
...
nm_settings_add_connection_dbus() invokes the activation_add_done()
callback with a NULL @new_connection in case of error: add a check to
prevent a crash.
2016-12-23 14:20:15 +01:00
Beniamino Galvani
30a1e17cc0
policy: don't apply DNS configuration for non-active devices
...
Don't apply DNS configuration of non-active devices (for example
unmanaged ones which have a non-empty DNS configuration read from a
DHCP lease).
https://bugzilla.redhat.com/show_bug.cgi?id=1405431
2016-12-21 09:37:22 +01:00
Dan Williams
0c5aa6e48b
wifi: don't request new PSK for locally-generated WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY errors
...
This usually indicates that the driver missed beacons from the AP, due to driver bugs
or faulty power-save management. It doesn't mean that the PSK is wrong.
2016-12-20 10:06:42 -06:00
Thomas Haller
16aeac5c3e
libnm: add nm_utils_version() function to query libnm version at runtime
...
if (nm_utils_version () < NM_ENCODE_VERSION (1, 5, 0))
g_error ("Requires at least version 1.5.0");
2016-12-20 16:51:58 +01:00
Thomas Haller
d2b9f37455
libnm: add public macro NM_VERSION for the current build-time version of libnm
2016-12-20 16:51:52 +01:00
Thomas Haller
c75c77d757
core: merge branch 'th/cancel-get-secrets-bgo776168'
...
https://bugzilla.gnome.org/show_bug.cgi?id=776168
2016-12-20 15:54:43 +01:00
Thomas Haller
4c853e80f0
ethernet: cancel get-secrets request in ethernet device
...
Same as for NMDeviceWifi.
2016-12-20 15:53:41 +01:00
Thomas Haller
e6bf047ccc
wifi: cancel get-secrets request in wifi device
...
I got an assertion failure:
wifi_secrets_cb: assertion 'nm_device_get_state (device) == NM_DEVICE_STATE_NEED_AUTH' failed
with backtrace [1].
I think, we have to keep track of the pending secrets request
and cancel it when the device state changes.
[1]:
#0 0x00007fad615a7a21 _g_log_abort (libglib-2.0.so.0)
#1 0x00007fad615a8e2d g_logv (libglib-2.0.so.0)
#2 0x00007fad615a8f8f g_log (libglib-2.0.so.0)
#3 0x000055e45e3fc718 get_secrets_cb (NetworkManager)
#4 0x000055e45e3dfada _get_secrets_info_callback (NetworkManager)
#5 0x000055e45e460d8d req_complete_release (NetworkManager)
#6 0x000055e45e462a7f _con_get_try_complete_early (NetworkManager)
#7 0x000055e45e462cb6 request_start (NetworkManager)
#8 0x00007fad6159e8e7 g_idle_dispatch (libglib-2.0.so.0)
#9 0x00007fad615a1e42 g_main_dispatch (libglib-2.0.so.0)
#10 0x00007fad615a21c0 g_main_context_iterate (libglib-2.0.so.0)
#11 0x00007fad615a24e2 g_main_loop_run (libglib-2.0.so.0)
#12 0x000055e45e2bf561 main (NetworkManager)
#13 0x00007fad60d97401 __libc_start_main (libc.so.6)
#14 0x000055e45e2bfc6a _start (NetworkManager)
2016-12-20 15:53:41 +01:00