summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* service: harden the NetworkManager service a bitlr/systemd-hardenedLubomir Rintel2015-07-011-0/+3
| | | | | | Tested with dnsmasq (ipv4.method=shared), openvpn & vpnc. https://bugzilla.gnome.org/show_bug.cgi?id=750598
* core: merge branch 'th/device-route-bgo751264'Thomas Haller2015-07-0123-327/+761
|\ | | | | | | | | | | | | | | | | Several fixes to route and address handling in platform. Especially refactor managing of IPv4 device routes and let NMRouteManager handle them. https://bugzilla.gnome.org/show_bug.cgi?id=751264 https://bugzilla.redhat.com/show_bug.cgi?id=1211287
| * route-manager: manage IPv4 device-routes with NMRouteManagerThomas Haller2015-07-019-124/+314
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When adding an IPv4 address, kernel will also add a device-route. We don't want that route because it has the wrong metric. Instead, we add our own route (with a different metric) and remove the kernel-added one. This could be avoided if kernel would support an IPv4 address flag IFA_F_NOPREFIXROUTE like it does for IPv6 (see related bug rh#1221311). One important thing is, that we want don't want to manage the device-route on assumed devices. Note that this is correct behavior if "assumed" means "do-not-touch". If "assumed" means "seamlessly-takeover", then this is wrong. Imagine we get a new DHCP address. In this case, we would not manage the device-route on the assumed device. This cannot be fixed without splitting unmanaged/assumed with related bug bgo 746440. This is no regression as we would also not manage device-routes for assumed devices previously. We also don't want to remove the device-route if the user added it externally. Note that here we behave wrongly too, because we don't record externally added kernel routes in update_ip_config(). This still needs fixing. Let IPv4 device-routes also be managed by NMRouteManager. NMRouteManager has a list of all routes and can properly add, remove, and restore the device route as needed. One problem is, that the device-route does not get added immediately with the address. It only appears some time later. This is solved by NMRouteManager watching platform and if a matchin device-route shows up within a short time after configuring addresses, remove it. If the route appears after the short timeout, assume they were added for other reasons (e.g. by the user) and don't remove them. https://bugzilla.gnome.org/show_bug.cgi?id=751264 https://bugzilla.redhat.com/show_bug.cgi?id=1211287
| * route-manager: consider also 'proto kernel' routes during route_flush()Thomas Haller2015-07-011-2/+2
| |
| * platform: properly consider address lifetimes in nm_platform_ip4_address_sync()Thomas Haller2015-07-011-12/+22
| | | | | | | | | | | | | | When checking whether an address from platform should be deleted, we compare the address with our list of @known_addresses. For that we must also check for expired lifetimes, because @known_addresses might contain expired addresses.
| * route-manager: add argument @ignore_kernel_routes to route_sync()Thomas Haller2015-07-015-18/+23
| | | | | | | | Will be used later, no behavioral change yet.
| * route-manager: process platform events before syncing routesThomas Haller2015-07-011-0/+2
| | | | | | | | | | Let's ensure we have a fresh platform cache before starting to sync.
| * route-manager: keep a reference of the platform instanceThomas Haller2015-07-011-4/+19
| | | | | | | | | | | | | | Soon we will subscribe to the platform instance for change signals. If a singleton instance uses another singleton instance, it should keep a reference to it, especially if it subscribes to a signal (that will be disconnected on dispose()).
| * libnm: add _nm_utils_ptrarray_find_binary_search() helperThomas Haller2015-07-013-0/+140
| |
| * platform: expose routes with "proto kernel" tooThomas Haller2015-07-013-8/+30
| | | | | | | | | | Also expose routes with "proto kernel". But add a flag to nm_platform_ipx_route_get_all() to hide them by default.
| * platform: change NMPlatformGetRouteMode enum to NMPlatformGetRouteFlags flagsThomas Haller2015-07-0114-63/+59
| | | | | | | | | | By having flags instead of an enum/mode, we can encode more combinations of filtering the result.
| * platform/trivial: rename enum value NM_IP_CONFIG_SOURCE_RTPROT_KERNELThomas Haller2015-07-014-6/+6
| | | | | | | | This source type was platform internal up to now. Next we will expose it.
| * core: minor refactoring iterating and removing list of routesThomas Haller2015-07-012-6/+8
| | | | | | | | | | | | | | | | The previous version causes an unsigned integer underflow. That is not wrong, but still change it. Also use g_array_remove_index_fast() because the list of routes is unsorted anyway.
| * platform: track pref_src field of IPv4 routesThomas Haller2015-07-014-13/+28
| |
| * platform: fix setting valid lifetimes when constructing rtnl_addr objectThomas Haller2015-07-012-12/+21
| | | | | | | | | | | | | | | | | | build_rtnl_addr() has two parameters "lifetime" and "preferred". Both count from *now*. Fix nmp_object_to_nl() to properly set these timestamps. This bug had not real consequences, because the only place where we use nmp_object_to_nl() the arguments are 0.
| * platform: move address lifetime utils function to nm-platform-utils.cThomas Haller2015-07-013-73/+101
|/
* platform: fix initializing vlan_id for NMPlatformLink instance from libnl objectThomas Haller2015-07-011-14/+38
| | | | | | If the vlan-information is missing, we must consult the cache. Fixes: 8a1f4beb65111b88b1114afac96c33a9970301c5
* device: restart ping process when it exits with an errorBeniamino Galvani2015-07-012-41/+85
| | | | | | | | | | When ping is launched to check the connectivity to the gateway it may return earlier than the given timeout in case of error. When this happens we need to respawn it until the timeout is reached. While at it, increase maximum timeout value to 600 seconds. https://bugzilla.redhat.com/show_bug.cgi?id=1128581
* core: merge branch 'th/device-cleanup-bgo751733'Thomas Haller2015-07-015-38/+60
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=751733
| * device: fix cleanup DHCP instance when unmanaging device on removed platform ↵Thomas Haller2015-07-011-29/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | link When the platform link gets removed outside of NetworkManager, we would unmanage the device first. By checking the device state reason NM_DEVICE_STATE_REASON_REMOVED, we would then not deconfigure the interface, as it is already gone. This was not correct because we must at least stop the dhcp client. Otherwise the dhclient process keeps running. That meant, if the device reappeared later, we would start dhclient again. Then we would find the PID of the still running instance in the pidfile and kill it only than. Fix it by replacing the 'deconfigure' boolean by a tri-state 'cleanup_type'.
| * dhcp: properly reap child process in nm_dhcp_client_stop_existing()Thomas Haller2015-06-301-4/+11
| | | | | | | | | | | | We kill the process based on the PID from the pidfile. This can be our own child process so we must use nm_utils_kill_child_sync() instead of nm_utils_kill_process_sync().
| * core: return parent pid from nm_utils_get_start_time_for_pid()Thomas Haller2015-06-304-6/+13
|/
* core: do not manage devices that are not initialized by platformJiří Klimeš2015-06-301-4/+1
| | | | | | | Commit 388b7830f322b60960884328ff51f7b4df0ef3d3 added NM_UNMANAGED_PLATFORM_INIT. Fixes: 388b7830f322b60960884328ff51f7b4df0ef3d3 Fixes:Beaker: NetworkManager_Test35_veth_goes_to_unmanaged_state
* core: fix memleak in nm_utils_get_start_time_for_pid() and parsing start-timeThomas Haller2015-06-301-11/+7
| | | | | It was leaking @tokens in case of error. Also the error checking of start-time with strtoull() was erroneous.
* dhcp: wait at most 2000 msec to kill existing dhcp processThomas Haller2015-06-301-1/+1
|
* core: add @max_wait_msec argument to nm_utils_kill_process_sync()Thomas Haller2015-06-303-17/+54
|
* core: fix nm_utils_kill_process_sync() not to hang for a zombie processThomas Haller2015-06-304-7/+37
| | | | | | | kill(pid,sig) can return success for zombie processes. This caused nm_utils_kill_process_sync() to hang indefinitely. Fix it by also checking the process state.
* device/trivial: refactor declaration of NMUnmanagedFlags enum flagsThomas Haller2015-06-291-7/+7
|
* ipx-config: fix testLubomir Rintel2015-06-281-4/+4
| | | | Fixes: c942a8c35b8c8aa00dd75d58ffe02db441de040c
* ipx-config: correct nm_ipx_config_merge() setting prioritiesLubomir Rintel2015-06-282-5/+5
| | | | | | ip[46]_config_merge_and_apply() do assume the settings that are merged later in override the previously set ones and not the other way around. Otherwise e.g. a gateway address from DHCP could override what's set in the connection.
* device: only reset ipx fields when there L3 configuration is presentLubomir Rintel2015-06-281-12/+16
| | | | Fixes: 79630c11e502c3b0b958abc0b1b5d777a3db2a98
* setting: prettify logging hostname changesThomas Haller2015-06-261-4/+6
| | | | | | | Also, avoid passing NULL for "%s" format. While glibc is fine with it, don't rely on that. Fixes: 6dc35e66d45e490482ac2909385099d77c26ed93
* route-manager: fix return value of _vx_route_sync()Beniamino Galvani2015-06-261-10/+12
| | | | | | | When the call to route_add() fails and the route is SOURCE_USER the function must return an error. Fixes: 62c652c3520e5427952dd0788eb56d7043fdc6b7
* libnm: backport autoconnect-slaves symbols to libnm_1_0_4Thomas Haller2015-06-262-0/+9
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=751535
* macros: add NM_BACKPORT_SYMBOL()Dan Winship2015-06-262-3/+15
| | | | | | | | | | | Add a macro to insert the necessary compiler/linker magic to add a copy of an existing symbol to an older version. Also, update check-exports.sh to be able to check for such symbols by listed them commented-out in the appropriate section. [thaller@redhat.com: patch modified] Related: https://bugzilla.gnome.org/show_bug.cgi?id=742993
* linux-platform: don't try to read vlan id from netlink objects without type setLubomir Rintel2015-06-261-1/+1
| | | | They just don't have the information.
* device: renew DHCP lease for active "ignore-carrier" devices on carrier-on ↵Jiří Klimeš2015-06-261-33/+39
| | | | | | | | | (bgo #743368) When carrier appears (e.g. the plug was re-inserted) we re-new addresses, because the network could change. https://bugzilla.gnome.org/show_bug.cgi?id=743368
* config,dns: merge branch 'th/dns-update-on-sigusr1-rh1062301'Thomas Haller2015-06-268-38/+90
|\ | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1062301
| * dns: rewrite "resolv.conf" on SIGHUP and SIGUSR1th/dns-update-on-sigusr1-rh1062301Thomas Haller2015-06-251-9/+13
| | | | | | | | | | | | | | | | Also rewrite resolv.conf if the configuration didn't actually change. Especially, react on SIGUSR1 which does not reload the configuration but only writes "resolv.conf". https://bugzilla.redhat.com/show_bug.cgi?id=1062301
| * config: pass signals to nm_config_reload()Thomas Haller2015-06-257-29/+77
|/ | | | | | | Also react on SIGUSR1 and SIGUSR2, beside SIGHUP. Only for SIGHUP actually reload the configuration from disc. For the other signals only emit a config-changed signal.
* platform: fix inverting guint8 value inet6_addr_gen_mode_invThomas Haller2015-06-253-5/+6
| | | | Fixes: e8e455817b340f60b396ba5d41425ed4de4c8554
* team: fix potential crash if team binary doesn't existThomas Haller2015-06-251-1/+1
| | | | | | | | | warning: Access to field 'message' results in a dereference of a null pointer (loaded from variable 'error') # 552| if (!teamd_kill (self, NULL, &error)) { # 553|-> _LOGW (LOGD_TEAM, "existing teamd config mismatch; failed to kill existing teamd: %s", error->message); # 554| *reason = NM_DEVICE_STATE_REASON_TEAMD_CONTROL_FAILED; Fixes: 24a764e831bff27647bb5025c1368582fade21cf
* platform/coverity: add workarounds to suppress coverify warningsThomas Haller2015-06-252-12/+14
|
* platform/test: minor test fix in "test-nmp-object.c"Thomas Haller2015-06-251-1/+0
|
* libnm-glib: avoid coverity warningThomas Haller2015-06-251-1/+1
| | | | | | | | | | 5. NetworkManager-1.0.3/libnm-glib/nm-remote-settings.c:493: var_compare_op: Comparing "error" to null implies that "error" might be null. 8. NetworkManager-1.0.3/libnm-glib/nm-remote-settings.c:508: var_deref_op: Dereferencing null pointer "error". # 506| g_hash_table_remove (priv->pending, path); # 507| # 508|-> if (print_once && error->code == DBUS_GERROR_LIMITS_EXCEEDED) { # 509| g_printerr ("Warning: libnm-glib:%s(): a D-Bus limit exceeded: %s. The application might not work properly.\n" # 510| "Consider increasing max_replies_per_connection limit in /etc/dbus-1/system.d/org.freedesktop.NetworkManager.conf "
* device: fix handling of ignore-auto-dns and ignore-auto-routesBeniamino Galvani2015-06-251-3/+26
| | | | | | | | | | | | | | Since commit ab6548c62134 ("device: better accept external IP changes"), ipX_config_merge_and_apply() applies the configuration static settings to an intermediate, initially empty configuration (priv->con_ipX_config) instead of the composite configuration, and thus the handling of ignore-auto-routes and ignore-auto-dns options done in nm_ipX_config_merge_setting() has no effect. Fix this by clearing the routes and the DNS information when needed before merging static settings to the composite configuration. Fixes: ab6548c62134518ba2871306397e7fb9c84260ca
* core: return more meaningful error when no device is found for activationJiří Klimeš2015-06-251-1/+1
| | | | | | | | | | | | Example: $ nmcli con add type eth con-name profile ifname nosuch $ nmcli con up profile or # ip link set eth0 down $ nmcli con add type eth con-name my-eth0 ifname eth0 $ nmcli con up my-eth0 Related to: 6fc3736c7ac139e40cb9f72b722b95b93c474979
* merge: branch 'lr/master-activations'Lubomir Rintel2015-06-243-12/+34
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=750595
| * manager: reuse an active connection, if the same activation is pendinglr/master-activationsLubomir Rintel2015-06-241-1/+25
| | | | | | | | | | When a master & slaves get activated at the same time, they all submit separate active connections which race for the device after activation.
| * active-connection: fail the activation if the master AC disconnectLubomir Rintel2015-06-241-2/+3
| | | | | | | | | | The master may not have successfully activated even though we know the device already.