summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* device: don't flush addresses when unmanaging assumed devicesbg/rh1363995Beniamino Galvani2016-08-181-13/+16
| | | | | | | | | | | | When a assumed software device is brought down externally, it becomes UNMANAGED_EXTERNAL_DOWN and its state goes from ACTIVATED directly to UNMANAGED. In such case, we shouldn't flush the IP configuration (addresses and routes) present on the device. To fix this, clean up the device with CLEANUP_TYPE_KEEP and modify nm_device_cleanup() not to flush addresses and devices with such flag. https://bugzilla.redhat.com/show_bug.cgi?id=1363995
* core: don't suppress routes inside the subnet of the interfaceThomas Haller2016-08-172-16/+0
| | | | | | | | | | | | | | | | | | It's not clear why a route should be suppressed if it is contained in the subnet of one of the interface's addresses. I think it is wrong to do this. For example, imagine an ethernet and a Wi-Fi device both connected to the same subnet 10.0.0.0/8. By default, ethernet gets higher priority and a better metric of 100. If the user wants to configure a route "10.0.0.1/32 metric 99" to reach a certain host explicitly via Wi-Fi, this check will forbid that. This condition was added a long time ago (38dbdae26606f984f1d12c8a56ed27bc1b4d9c20), but it's unclear what the original intent was. See also commit 4f7b1cabc063bfda96cb5c129d6a233e5d5cff68, which already relaxed this suppression of routes for non-direct routes.
* all: cleanup includes in header filesThomas Haller2016-08-1783-274/+32
| | | | | | | | | | - don't include "nm-default.h" in header files. Every source file must include as first header "nm-default.h", thus our headers get the default include already implicitly. - we don't support compiling NetworkManager itself with a C++ compiler. Remove G_BEGIN_DECLS/G_END_DECLS from internal headers. We do however support users of libnm to use C++, thus they stay in public headers.
* device: always expose device statistics informationThomas Haller2016-08-171-28/+27
| | | | | | | | | | | | | | | | Instead of updating the device-statistic counters only periodically as we refresh the link, update them on every link-changed event from platform. That means, also for devices that have RefreshRateMs at zero, the values will be updated at random times when the link information changes. The difference is, that previously the counters would be zero unless RefreshRateMs was set. Now, they have some (probably stale) values which however are not guaranteed to be kept up-to-date. Also, now we refresh more often then promised by RefreshRateMs. But the API technically doesn't specify that, so if we find there is a problem with this, we may revert it later.
* device: drop nm-device-statistics.c and refactor tracking device statisticsThomas Haller2016-08-175-187/+107
| | | | | | Originally, "nm-device-statistics.c" contained code to fetch the device counters via netlink. As now the netlink part is handled by NMPlatform, the code can be simplified by merging it back to NMDevice.
* platform: print rx/tx counters in nm_platform_link_to_string()Thomas Haller2016-08-171-1/+5
|
* device: namespace fields related to statistics in NMDevicePrivateThomas Haller2016-08-171-32/+34
| | | | ... by grouping them together in a struct.
* device: don't initalize fields in nm_device_init() to NULLThomas Haller2016-08-171-5/+0
| | | | They are already guaranteed to be 0/NULL.
* manager: add explicit cast for g_object_set()Thomas Haller2016-08-171-1/+1
| | | | | | | | Technically, this is not needed because glib requires that int is at least 32 bits. Thus, uint32 will be safely promoted to uint. Just do the cast to be explict about the expected type.
* device: refresh the link before reading the statsThomas Haller2016-08-171-3/+2
|
* device: reset device-stats in update_stats() on missing linkThomas Haller2016-08-171-4/+7
| | | | | First of all, we don't expect missing NMPlatformLink instances. If that actually happens, just reset the counters to zero.
* platform: drop nm_platform_link_get_stats()Thomas Haller2016-08-174-55/+7
| | | | | No need to add accessors for fields of NMPlatformLink. Just access them directly.
* platform: let _new_from_nl_link() lookup missing tb[IFLA_STATS64] data from ↵Thomas Haller2016-08-171-1/+8
| | | | cache
* platform: fix sorting order for nm_platform_link_cmp()Thomas Haller2016-08-171-4/+4
| | | | | | | | nm_platform_link_cmp() shall first compare the ifindex, otherwise the sort-order first considers rather unimportant fields instead of the primary key: the ifindex. Fixes: a3185f22e55484b819859cb4cef8f54385dac1a9
* auth: check when setting statistics refresh rateAlfonso Sanchez-Beato2016-08-172-0/+16
|
* device: add statistics interfaceAlfonso Sanchez-Beato2016-08-176-0/+256
| | | | | | | | | | | | Add statistics interface to all device instances. When active, the properties of this interface are refreshed whenever there is network activity for the device. Activation is performed by changing RefreshRateMs property. If set to zero, the interface is deactivated. If set to other value, the rest of the interface properties are refreshed whenever the related network metric changes, being RefreshRateMs the minimum time between property changes, in milliseconds.
* platform/tests: relax condition in platform testThomas Haller2016-08-171-1/+1
| | | | | With device-statistics counters in NMPlatformLink we may get an additional link-changed event. Relax the assertion in the test.
* platform: add network statisticsAlfonso Sanchez-Beato2016-08-173-0/+63
| | | | Make network traffic statistics data available through the platform.
* exported-object: allow exporting multiple ifacesAlfonso Sanchez-Beato2016-08-171-8/+10
| | | | Allow exporting more than one interface per object class.
* device: copy the plink instance before realize_start_setup()Thomas Haller2016-08-171-0/+6
| | | | | | To make sure, we don't end up with a dangling pointer due to an intermediate platform access which may invalidate the pointer.
* permissions: properly add checkpoint-rollback permissionThomas Haller2016-08-171-0/+2
| | | | Fixes: a52d4654ec4d3afbbb0ef70ada55f4a5ddac92db
* act-request: queue failing the slave when master failsLubomir Rintel2016-08-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We might be already handling a state change: Aug 17 05:26:34 dacan.local NetworkManager[618]: (devices/nm-device.c:10982): _set_state_full: runtime check failed: (priv->in_state_changed == FALSE) (gdb) bt #0 0x00007fc218dad643 in g_logv (log_domain=0x7fc21c0db3c3 "NetworkManager", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>, args=args@entry=0x7ffe6f0b30d0) at gmessages.c:1086 #1 0x00007fc218dad7bf in g_log (log_domain=log_domain@entry=0x7fc21c0db3c3 "NetworkManager", log_level=log_level@entry=G_LOG_LEVEL_WARNING, format=format@entry=0x7fc218e1b70f "%s") at gmessages.c:1119 #2 0x00007fc218dadb16 in g_warn_message (domain=domain@entry=0x7fc21c0db3c3 "NetworkManager", file=file@entry=0x7fc21c0d6597 "devices/nm-device.c", line=line@entry=10982, func=func@entry=0x7fc21c0dabf0 <__FUNCTION__.42233> "_set_state_full", warnexpr=warnexpr@entry=0x7fc21c0d95a0 "priv->in_state_changed == FALSE") at gmessages.c:1152 #3 0x00007fc21bf79bd6 in _set_state_full (self=0x7fc21ccd88b0 [NMDeviceEthernet], state=NM_DEVICE_STATE_FAILED, reason=NM_DEVICE_STATE_REASON_DEPENDENCY_FAILED, quitting=0) at devices/nm-device.c:10982 #7 0x00007fc2190bdd9f in <emit signal notify:master on instance 0x7fc21ccd88b0 [NMDeviceEthernet]> (instance=instance@entry=0x7fc21ccd88b0, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3439 #4 0x00007fc2190a3908 in g_closure_invoke (closure=0x7fc21cd009e0, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7ffe6f0b34b0, invocation_hint=invocation_hint@entry=0x7ffe6f0b3450) at gclosure.c:801 #5 0x00007fc2190b5a1d in signal_emit_unlocked_R (node=node@entry=0x7fc21cb66500, detail=detail@entry=588, instance=instance@entry=0x7fc21ccd88b0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffe6f0b34b0) at gsignal.c:3627 #6 0x00007fc2190bdab1 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffe6f0b3640) at gsignal.c:3383 #8 0x00007fc2190a7fd4 in g_object_dispatch_properties_changed (object=0x7fc21ccd88b0 [NMDeviceEthernet], n_pspecs=<optimized out>, pspecs=<optimized out>) at gobject.c:1061 #9 0x00007fc2190aa619 in g_object_notify_by_pspec (pspec=<optimized out>, object=0x7fc21ccd88b0 [NMDeviceEthernet]) at gobject.c:1155 #10 0x00007fc2190aa619 in g_object_notify_by_pspec (object=object@entry=0x7fc21ccd88b0 [NMDeviceEthernet], pspec=<optimized out>) at gobject.c:1264 #11 0x00007fc21bf7de3f in nm_device_master_enslave_slave (prop=PROP_MASTER, obj=0x7fc21ccd88b0 [NMDeviceEthernet]) at devices/nm-device.c:103 #12 0x00007fc21bf7de3f in nm_device_master_enslave_slave (success=1, self=0x7fc21ccd88b0 [NMDeviceEthernet]) at devices/nm-device.c:2757 #13 0x00007fc21bf7de3f in nm_device_master_enslave_slave (self=0x7fc21cd42810 [NMDeviceBond], slave=0x7fc21ccd88b0 [NMDeviceEthernet], connection=<optimized out>) at devices/nm-device.c:1300 #14 0x00007fc2167c8dcc in ffi_call_unix64 () at ../src/x86/unix64.S:76 #15 0x00007fc2167c86f5 in ffi_call (cif=cif@entry=0x7ffe6f0b3a10, fn=<optimized out>, rvalue=0x7ffe6f0b3980, avalue=avalue@entry=0x7ffe6f0b3900) at ../src/x86/ffi64.c:522 #20 0x00007fc2190be2e8 in <emit signal 0x7fc21c0ea3d5 "state-changed" on instance 0x7fc21ccd88b0 [NMDeviceEthernet]> (instance=instance@entry=0x7fc21ccd88b0, detailed_signal=detailed_signal@entry=0x7fc21c0ea3d5 "state-changed") at gsignal.c:3479 #16 0x00007fc2190a4148 in g_cclosure_marshal_generic (closure=0x7fc21cc84de0, return_gvalue=0x0, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>, marshal_data=0x0) at gclosure.c:1487 #17 0x00007fc2190a3908 in g_closure_invoke (closure=0x7fc21cc84de0, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7ffe6f0b3c10, invocation_hint=invocation_hint@entry=0x7ffe6f0b3bb0) at gclosure.c:801 #18 0x00007fc2190b5a1d in signal_emit_unlocked_R (node=node@entry=0x7fc21cbeef20, detail=detail@entry=0, instance=instance@entry=0x7fc21ccd88b0, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffe6f0b3c10) at gsignal.c:3627 #19 0x00007fc2190bdab1 in g_signal_emit_valist (instance=instance@entry=0x7fc21ccd88b0, signal_id=signal_id@entry=112, detail=detail@entry=0, var_args=var_args@entry=0x7ffe6f0b3e48) at gsignal.c:3383 #21 0x00007fc21bf79e3d in _set_state_full (self=self@entry=0x7fc21ccd88b0 [NMDeviceEthernet], state=state@entry=NM_DEVICE_STATE_IP_CONFIG, reason=reason@entry=NM_DEVICE_STATE_REASON_NONE, quitting=quitting@entry=0) at devices/nm-device.c:11123 #22 0x00007fc21bf7a707 in nm_device_state_changed (self=self@entry=0x7fc21ccd88b0 [NMDeviceEthernet], state=state@entry=NM_DEVICE_STATE_IP_CONFIG, reason=reason@entry=NM_DEVICE_STATE_REASON_NONE) at devices/nm-device.c:11308 #23 0x00007fc21bf7e92f in activate_stage3_ip_config_start (self=0x7fc21ccd88b0 [NMDeviceEthernet]) at devices/nm-device.c:6759 #24 0x00007fc21bf68dac in activation_source_handle_cb (self=0x7fc21ccd88b0 [NMDeviceEthernet], family=family@entry=2) at devices/nm-device.c:3627 #25 0x00007fc21bf68e6e in activation_source_handle_cb4 (user_data=<optimized out>) at devices/nm-device.c:3564 #26 0x00007fc218da6d7a in g_main_context_dispatch (context=0x7fc21cb6e000) at gmain.c:3152 #27 0x00007fc218da6d7a in g_main_context_dispatch (context=context@entry=0x7fc21cb6e000) at gmain.c:3767 #28 0x00007fc218da70b8 in g_main_context_iterate (context=0x7fc21cb6e000, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3838 #29 0x00007fc218da738a in g_main_loop_run (loop=0x7fc21cb6c8c0) at gmain.c:4032 #30 0x00007fc21bf4a23e in main (argc=1, argv=0x7ffe6f0b43e8) at main.c:411 (gdb) https://bugzilla.redhat.com/show_bug.cgi?id=1367702
* checkpoint: add audit supportBeniamino Galvani2016-08-173-17/+37
|
* checkpoint: use polkit to check permissionBeniamino Galvani2016-08-171-44/+97
|
* checkpoint: add create, rollback and destroy D-Bus APIBeniamino Galvani2016-08-177-2/+961
| | | | Co-authored-by: Thomas Haller <thaller@redhat.com>
* core: fix builds without polkit supportBeniamino Galvani2016-08-171-2/+2
| | | | | | | | | | Fix the following build error: nm-auth-utils.c: In function ‘nm_auth_chain_add_call’: nm-auth-utils.c:402:46: error: ‘DBUS_GERROR’ undeclared (first use in this function) call->chain->error = g_error_new_literal (DBUS_GERROR, Fixes: 1cf35cb26b6cc04f8b2c51c3cde4bc08ef311062
* build: rename $(LIBDL) to $(DL_LIBS) and modify detectionThomas Haller2016-08-152-3/+3
|
* build: use $(LIBDL) in ppp-manager's Makefile.amThomas Haller2016-08-151-1/+2
|
* systemd: cleanup systemd's include paths in src/Makefile.amThomas Haller2016-08-121-10/+8
| | | | | Certain systemd include paths are internal and should not be added to the include paths when compiling non-systemd sources.
* systemd: hide "nm-sd-adapt.h" and expose required internal API in "nm-sd.h"Thomas Haller2016-08-126-5/+21
| | | | | | | | | | Users outside of src/systemd should not make use of internal API. Currently, "nm-dhcp-systemd.c" still makes use of internal systemd functions. Instead of letting "nm-dhcp-systemd.c" include internal headers, handpick the required defines to "nm-sd.h" and hide "nm-sd-adapt.h". "nm-sd-adapt.h" is now only used to compile internal systemd sources.
* systemd: add dummy header files to adapt compilation of systemd sourcesThomas Haller2016-08-1236-62/+86
| | | | | | | | | | Instead of repeatedly disabling the inclusion like #if 0 /* NM_IGNORED */ #include "missing.h" #endif /* NM_IGNORED */ add dummy header files to "src/systemd/sd-adapt".
* systemd: merge branch systemd into masterThomas Haller2016-08-1227-210/+774
|\ | | | | | | | | | | | | | | Conflicts: src/systemd/src/basic/fd-util.c src/systemd/src/basic/fileio.c src/systemd/src/libsystemd/sd-event/sd-event.c src/systemd/src/libsystemd/sd-id128/sd-id128.c
| * systemd: update code from upstreamThomas Haller2016-08-1225-207/+751
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a direct dump from systemd git on 2016-08-11, git commit 9c5077fed42dc3cd2517a7ab816babef549dd079. ====== SYSTEMD_DIR=../systemd COMMIT=9c5077fed42dc3cd2517a7ab816babef549dd079 ( 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"
* | systemd/tests: don't link test-systemd against libNetworkManagerBaseThomas Haller2016-08-122-1/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | One point of test-systemd is to see whether our internal systemd code can fully link without external systemd library. In fact, we want all symbols from the internal systemd code to resolve, because when we link against an external libsystemd library, we may mix differing APIs, resulting in subtle bugs. Currently, it may well be that libNetworkManagerBase.la already links against libsystemd, which would result in test-systemd to wrongly succeed resolving all names. Fix that, by don't link libNetworkManagerBase.la into test-systemd.
* | build: remove libsystemd-nm.la LDADD from nm-iface-helperThomas Haller2016-08-111-1/+0
| |
* | build: fix out-of-tree build for libNetworkManagerTestThomas Haller2016-08-111-1/+1
| | | | | | | | Fixes: 3d30004710d46c3e7aa66773e3c9a2c36ad048e6
* | core: add nm_bus_manager_ensure_root() helperThomas Haller2016-08-113-27/+39
| |
* | build: cleanup src/Makefile.amThomas Haller2016-08-114-148/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | - reorder entries in src/Makefile.am so that general names are all at the beginning (AM_CPPFLAGS, sbin_PROGRAMS) and the names for a certain library/binary are grouped together - have libNetworkManager.la reuse libNetworkManagerBase.la. - let all components in src/Makefile.am use the same AM_CPPFLAGS, except libsystem-nm.la. - move callouts/nm-dispatcher-api.h to shared/ directory. It is obviously not internal API to callouts, and callouts is not a library. Thus, the right place is shared/.
* | build: rename libNetworkManager-base.la to libNetworkManagerBase.laThomas Haller2016-08-112-5/+5
| | | | | | | | it matches libNetworkManagerTest.la.
* | bulid: don't link NMFakePlatform into NetworkManager binaryThomas Haller2016-08-115-10/+18
| | | | | | | | | | It's only used for testing. Add a new object libNetworkManagerTest.la that contains libNetworkManager.la including the test stubs.
* | policy: fix hostname change when IP method ends after activation (take 2)Beniamino Galvani2016-08-091-18/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 9446481f4cc0 ("policy: update system hostname when DHCP configuration changes") tried to fix the missing hostname change when IPv4 receives a hostname through DHCP but terminates after IPv6, by calling update_routing_and_dns() as soon as the new DHCP configuration was received. It turns out that doing so is not always effective because the device must be the "best" device (the one with default route) in order to trigger a hostname change, but the best device status is decided later. Updating the hostname in device_ipx_config_changed() should cover all cases. Fixes: 9446481f4cc06c657d9467bce0921a85bb94ae6b https://bugzilla.redhat.com/show_bug.cgi?id=1356015 https://bugzilla.redhat.com/show_bug.cgi?id=1364393
* | nm-dispatcher: Added new 'connectivity-state' parameter to private D-Bus APIMario Sanchez Prada2016-07-283-13/+24
| | | | | | | | | | | | | | | | | | In order to pass the connectivity state to the relevant hooks along with the event itself, we need to add this parameter for the 'Action' method of then internal 'org.freedesktop.nm_dispatcher' interface, which will be sent by the network manager main process to the dispatcher. https://bugzilla.gnome.org/show_bug.cgi?id=768969
* | nm-dispatcher: Added new action for 'connectivity-change' eventsMario Sanchez Prada2016-07-283-5/+30
| | | | | | | | | | | | | | | | | | | | | | The purpose of this action is to provide a hook for the OS to act on global changes regarding to connectivity, which can currently be one of 'none', 'portal', 'limited', 'full' or 'unknown'. Check the documentation for a more information on each of those states: https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMConnectivityState https://bugzilla.gnome.org/show_bug.cgi?id=768969
* | policy: update system hostname when DHCP configuration changesBeniamino Galvani2016-07-271-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If both IPv4 and IPv6 are enabled and IPv6 terminates first (and ipv4.may-fail=yes), the device becomes ACTIVATED and we try to update the system hostname from the DHCP lease, if necessary. But later, the termination of DHCPv4 doesn't trigger a new update and so it's possible that the system hostname remains unset even if the DHCPv4 lease specifies a hostname. To have a deterministic behavior we should always try to update the system hostname when a DHCP transaction terminates. https://bugzilla.redhat.com/show_bug.cgi?id=1356015
* | team: update configuration when adding or removing slavesBeniamino Galvani2016-07-231-0/+24
| | | | | | | | | | | | | | | | | | Unfortunately teamd doesn't have an asynchronous way to notify a change in the actual configuration, so when a port is enslaved or released we wait some time for the changes to take effect and read the configuration again. https://bugzilla.redhat.com/show_bug.cgi?id=1310435
* | team: request actual configuration to teamdBeniamino Galvani2016-07-231-1/+1
| | | | | | | | | | | | Request the actual configuration when reading it from teamd. The actual configuration, differently from the normal one, doesn't contain non-active team ports.
* | device: enable checks against the MAC address of virtual devicesFrancesco Giudici2016-07-221-1/+1
| | | | | | | | | | | | enables (back) matching against 802-3-ethernet.mac-address and 802-3-ethenet.mac-address-blacklist connection parameters for MAC addresses belonging to virtual devices too.
* | device: allow creation of default wired connection for virtual interfacesFrancesco Giudici2016-07-221-1/+1
| |
* | dhcp: drop an unused fariableLubomir Rintel2016-07-131-2/+0
| | | | | | | | Fixes: 1c58ce0d748174b5b3a27dd077192b45fed2d0a4
* | all: reuse _nm_utils_hwaddr_ntoa() for converting binary to stringThomas Haller2016-07-102-35/+10
| |