summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* ifcfg-rh: clear IP settings for slave connectionsth/ifcfg-writer-clear-ip-for-slave-rh1368761Thomas Haller2016-08-234-67/+72
| | | | | | | | | | | | Clear some IP related entries from the ifcfg-rh file if the connection is a slave connection. Also, drop utils_ignore_ip_config(). It is guaranteed, that writer only handles connections that verify(). Such connections have an IPv4/IPv6 setting if (and only if) they are not slave types. https://bugzilla.redhat.com/show_bug.cgi?id=1368761
* core: use #define for "rfkill-changed" signal nameThomas Haller2016-08-233-3/+5
|
* core: check valid uid for D-Bus load_connection(s)/set_logging callsBeniamino Galvani2016-08-234-9/+61
| | | | | | | | | | | | | | | Commit 4c7fa8dfdcbf ("core: drop root requirement for load_connection(s)/set_logging D-Bus calls") removed the enforcing of permission in the daemon for such methods since the D-Bus daemon configuration already does that. That change also allows clients to send a request and not wait for a response, since we don't have to check the caller credentials in the daemon. In the future we might switch to polkit for these methods, breaking clients that don't wait for a reponse, so it seems better to prevent from beginning such behavior. Fixes: 4c7fa8dfdcbf13f3633b565af53896ac79366912
* core: merge branch 'th/vpn-ifindex-fix-rh1368354'Thomas Haller2016-08-234-90/+108
|\ | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1368354
| * vpn: ignore unexpected default-route for nm_vpn_connection_ip6_config_get()Thomas Haller2016-08-231-1/+1
| | | | | | | | | | | | The VPN data comes from an external source, it may be bogus. Default-routes are not allowed on this point and would trigger an assertion afterwards. Skip over them.
| * vpn: fix nm_vpn_connection_ip6_config_get() for VPNs without own interfaceThomas Haller2016-08-231-2/+12
| | | | | | | | | | | | | | | | | | | | We need an ifindex for the NMIP4Config/NMIP6Config instance. For interface-less VPN types, we need to lookup the parent device, as already done for IPv4. Fix IPv6 case too. https://bugzilla.redhat.com/show_bug.cgi?id=1368354
| * vpn: refactor property implementation in NMVpnConnectionThomas Haller2016-08-231-46/+41
| |
| * vpn: embed private data in NMVpnConnection structureThomas Haller2016-08-232-45/+58
| |
| * core: downgrade assertion in nm-ip[46]-config.c to g_criticalThomas Haller2016-08-232-4/+4
|/
* device: silence logging about "link disconnected"Thomas Haller2016-08-231-4/+1
| | | | | <info> logging is just too verbose for something that happens frequently.
* device: fix queued activation failure due to link disconnectedThomas Haller2016-08-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When activating a connection, it may fail with nmcli reporting: $ nmcli connection up id "Wired Connection 1" Error: Connection activation failed: Active connection removed before it was initialized This should be easily reproducible by having a connection "Wired Connection 1" with cloned-mac-address set to random. When the connection is already active on a device, re-activating with $ nmcli connection up id "Wired Connection 1" fails. We first create a queued-activation and tear down the existing connection: device (enp0s25): state change: deactivating -> disconnected (reason 'new-activation') Shortly after we see: device[0x557d02cdb0c0] (enp0s25): set-hw-addr: setting MAC address to 'AA:BB:CC:DD:EE:FF' (reset, deactivate)... device[0x557d02cdb0c0] (enp0s25): taking down device later, we get: device (enp0s25): link disconnected device[0x557d02cdb0c0] (enp0s25): queued state change to unavailable due to carrier-changed (id 17290) in the meantime, the queued activation request starts: device (enp0s25): Activation: starting connection 'my-wired' (ca058ec5-8a47-4e1e-b38e-962b71c4699e) but the device already transitions to unavailable device[0x557d02cdb0c0] (enp0s25): running queued state change to unavailable (id 17290) device (enp0s25): state change: disconnected -> unavailable (reason 'carrier-changed') [30 20 40] which kills the new activation request: active-connection[0x557d02c10e40]: set state deactivated (was unknown) Just delay a carrier-lost handling if we have any queued activation requests.
* platform: disable debug logging for NMPObject ref-coutingThomas Haller2016-08-221-3/+7
| | | | | | | | | These logging lines are already disabled by default as _LOGt() is a NOP unless configured --with-more-logging. However, the logging is still very verbose also for debug-builds and currently there are no known issues there. Disable the logging statements (but leave them in so they can easily be enabled).
* core: use define for signal name in nm_active_connection_set_device()Thomas Haller2016-08-221-1/+1
|
* device: emit NM_DEVICE_STATE_CHANGED signal by idThomas Haller2016-08-221-1/+1
| | | | | This saves a lookup of the ID by name. We already have the signal-id, use it.
* cli: return sane error message for D-Bus policy permission errorsBeniamino Galvani2016-08-204-3/+21
| | | | | | | | | | | | | | | | | | | | The error returned to users when a load_connection(s)/set_logging call fails due to D-Bus policy denial is a bit obscure: $ nmcli general logging level debug Error: failed to set logging: Rejected send message, 4 matched rules; type="method_call", sender=":1.233" (uid=1001 pid=27225 comm="nmcli general logging level debug ") interface="org.freedesktop.NetworkManager" member="SetLogging" error name="(unset)" requested_reply="0" destination=":1.207" (uid=0 pid=25793 comm="/usr/sbin/NetworkManager --no-daemon ") Convert it to a more comprehensible: $ nmcli general logging level debug Error: failed to set logging: access denied https://bugzilla.redhat.com/show_bug.cgi?id=1362542
* core: drop root requirement for load_connection(s)/set_logging D-Bus callsBeniamino Galvani2016-08-202-25/+0
| | | | | | | The D-Bus configuration already ensures that only root can do that; enforcing the permission at policy level seems better than doing it in the daemon itself because it allows users to change the policy and also because callers can exit immediately after issuing the request.
* ifcfg-rh: ensure master is cleared when updating a connectionBeniamino Galvani2016-08-192-6/+84
| | | | | | | If the connection is not a slave we must clear any existing variable indicating the connection's master. https://bugzilla.redhat.com/show_bug.cgi?id=1355656
* device: don't flush addresses when unmanaging assumed devicesBeniamino Galvani2016-08-191-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
* vpn: fix out-of-range access reading route.plen in ↵Thomas Haller2016-08-191-2/+4
| | | | | | | | | | nm_vpn_connection_ip4_config_get() Also, skip over routes with plen zero. Fixes: 44768f0311deb9082c69e3525693091a59788ebb https://bugzilla.redhat.com/show_bug.cgi?id=1368355
* logging: remove unused formatting optionsThomas Haller2016-08-191-98/+11
| | | | | | | | | | | | Previously, we logged also the location (file:line func). nm-logging.c supported format flags to control the timestamp, the location, and alignment of the timestamp. We want that all our logging backends log the same messages. That is, both syslog and journal should have our ~default~ logging format, that is with timestamp but without location. Drop the unused code.
* policy: always try to update kernel hostnameBeniamino Galvani2016-08-191-23/+20
| | | | | | | | | | | | | | | | | | | | | Even if we know that the new hostname being set is equal to the cached old one, the user may have manually changed the kernel hostname in the meanwhile. For example: # hostname host123 # hostname localhost # nmcli connection up eth1 # (now NM receives 'host123' from DHCP, but # believes it's already set and doesn't update it) # hostname localhost Let's always try to update the kernel (transient) hostname, unless it is really already set (as returned by gethostname()). https://bugzilla.redhat.com/show_bug.cgi?id=1356015
* platform/tests: relax condition for testThomas Haller2016-08-181-1/+1
| | | | Got a test failure for /link/software/bond
* contrib/rpm: fix wrong argument to configure scriptThomas Haller2016-08-181-1/+1
| | | | Fixes: aff491b6f319f41d9c812400f8f561a138580bb7
* contrib/rpm: update spec file to make it more similar to RHEL's versionThomas Haller2016-08-181-1/+7
|
* 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.
* po: update Polish (pl) translation (bgo #769463)Piotr Drąg2016-08-171-56/+75
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=769463
* all: cleanup includes in header filesThomas Haller2016-08-17163-558/+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.
* release: bump version to 1.5.0 (development)1.5.0-devLubomir Rintel2016-08-174-4/+33
|
* release: update NEWS with recently merged featuresLubomir Rintel2016-08-171-0/+3
|
* all: merge branch 'th/device-statistics'Thomas Haller2016-08-1721-14/+304
|\ | | | | | | | | | | Add support to expose tx/rx statistics per device https://mail.gnome.org/archives/networkmanager-list/2016-August/msg00045.html
| * device: always expose device statistics informationThomas Haller2016-08-172-32/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * docs: add device statistics interfaceAlfonso Sanchez-Beato2016-08-172-0/+2
| |
| * auth: check when setting statistics refresh rateAlfonso Sanchez-Beato2016-08-179-2/+40
| |
| * device: add statistics interfaceAlfonso Sanchez-Beato2016-08-179-1/+299
| | | | | | | | | | | | | | | | | | | | | | | | 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-176-2/+14
| | | | 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