Commit graph

12098 commits

Author SHA1 Message Date
Thomas Haller
8532b83f46 route-manager: add argument @ignore_kernel_routes to route_sync()
Will be used later, no behavioral change yet.

(cherry picked from commit 347555795f)
2015-07-01 16:10:50 +02:00
Thomas Haller
a698b70d0f route-manager: process platform events before syncing routes
Let's ensure we have a fresh platform cache before starting
to sync.

(cherry picked from commit c5c612d711)
2015-07-01 16:10:50 +02:00
Thomas Haller
74da44e3df route-manager: keep a reference of the platform instance
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()).

(cherry picked from commit b79ade8975)
2015-07-01 16:10:50 +02:00
Thomas Haller
976726f221 libnm: add _nm_utils_ptrarray_find_binary_search() helper
(cherry picked from commit 650fec81e2)
2015-07-01 16:10:50 +02:00
Thomas Haller
300a7ab4d1 platform: expose routes with "proto kernel" too
Also expose routes with "proto kernel". But add a flag
to nm_platform_ipx_route_get_all() to hide them by default.

(cherry picked from commit 42664e8752)
2015-07-01 16:10:50 +02:00
Thomas Haller
7082f44c2f platform: change NMPlatformGetRouteMode enum to NMPlatformGetRouteFlags flags
By having flags instead of an enum/mode, we can encode more combinations
of filtering the result.

(cherry picked from commit d9dba6b662)
2015-07-01 16:10:50 +02:00
Thomas Haller
44cb5b6b62 platform/trivial: rename enum value NM_IP_CONFIG_SOURCE_RTPROT_KERNEL
This source type was platform internal up to now. Next we will expose it.

(cherry picked from commit 85bf9ded2e)
2015-07-01 16:10:50 +02:00
Thomas Haller
1d2ff90a5c core: minor refactoring iterating and removing list of routes
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.

(cherry picked from commit e7f3ccf7cd)
2015-07-01 16:10:49 +02:00
Thomas Haller
e04d0c6e6b platform: track pref_src field of IPv4 routes
(cherry picked from commit 7594e31220)
2015-07-01 16:10:49 +02:00
Thomas Haller
af0d99cdcc platform: fix setting valid lifetimes when constructing rtnl_addr object
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.

(cherry picked from commit d0ed4de104)
2015-07-01 16:10:49 +02:00
Thomas Haller
a3c4bf81bb platform: move address lifetime utils function to nm-platform-utils.c
(cherry picked from commit 626a85530e)
2015-07-01 16:10:49 +02:00
Thomas Haller
14ef5f6b32 platform: prettify and line-wrap route_to_string() print statements
(cherry picked from commit 2170804213)
2015-07-01 16:10:37 +02:00
Thomas Haller
e7504376dc platform: fix initializing vlan_id for NMPlatformLink instance from libnl object
If the vlan-information is missing, we must consult the cache.

Fixes: 8a1f4beb65
(cherry picked from commit 871c4d90c7)
2015-07-01 15:47:08 +02:00
Beniamino Galvani
5fc247347f device: restart ping process when it exits with an error
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
(cherry picked from commit e86f8354a7)
2015-07-01 13:51:06 +02:00
Thomas Haller
77cbaf611a core: merge branch 'th/device-cleanup-bgo751733'
https://bugzilla.gnome.org/show_bug.cgi?id=751733

(cherry picked from commit e3348b46bd)
2015-07-01 11:44:25 +02:00
Thomas Haller
5e3e45cc82 device: fix cleanup DHCP instance when unmanaging device on removed platform 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'.

(cherry picked from commit 3b21738d9c)
2015-07-01 11:41:15 +02:00
Thomas Haller
31f06008c7 dhcp: properly reap child process in nm_dhcp_client_stop_existing()
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().

(cherry picked from commit c61c71a168)
2015-07-01 11:40:40 +02:00
Thomas Haller
fa9f7fe6e3 core: return parent pid from nm_utils_get_start_time_for_pid()
(cherry picked from commit 7c9eefa767)
2015-07-01 11:40:40 +02:00
Jiří Klimeš
a4a92299fb core: do not manage devices that are not initialized by platform
Commit 388b7830f3 added NM_UNMANAGED_PLATFORM_INIT.

Fixes: 388b7830f3
Fixes:Beaker: NetworkManager_Test35_veth_goes_to_unmanaged_state

(cherry picked from commit a396ad2ac1)
2015-06-30 15:52:37 +02:00
Thomas Haller
1cf9e989c1 core: fix memleak in nm_utils_get_start_time_for_pid() and parsing start-time
It was leaking @tokens in case of error. Also the error checking of
start-time with strtoull() was erroneous.

(cherry picked from commit 67057079a4)
2015-06-30 14:23:04 +02:00
Thomas Haller
cb29a2109f dhcp: wait at most 2000 msec to kill existing dhcp process
(cherry picked from commit 4fbd42a035)
2015-06-30 14:23:04 +02:00
Thomas Haller
69294f80f7 core: add @max_wait_msec argument to nm_utils_kill_process_sync()
(cherry picked from commit 7dc65df020)
2015-06-30 14:23:04 +02:00
Thomas Haller
c26294d6b0 core: fix nm_utils_kill_process_sync() not to hang for a zombie process
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.

(cherry picked from commit 69c98a336e)
2015-06-30 14:23:04 +02:00
Lubomir Rintel
dfff2265d3 ipx-config: fix test
Fixes: c942a8c35b
(cherry picked from commit 5dc23a28f8)
2015-06-28 21:37:09 +02:00
Lubomir Rintel
035afec4a2 ipx-config: correct nm_ipx_config_merge() setting priorities
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.

(cherry picked from commit c942a8c35b)
2015-06-28 21:21:56 +02:00
Lubomir Rintel
d5677dcd2b device: only reset ipx fields when there L3 configuration is present
Fixes: 79630c11e5
(cherry picked from commit 4843e625a8)
2015-06-28 20:12:20 +02:00
Beniamino Galvani
1ee9ff2cd6 route-manager: fix return value of _vx_route_sync()
When the call to route_add() fails and the route is SOURCE_USER the
function must return an error.

Fixes: 62c652c352
(cherry picked from commit 7364d7f8f2)
2015-06-26 16:46:52 +02:00
Thomas Haller
b30e7c9c61 version: add missing NM_AVAILABLE_IN_1_0_4 2015-06-26 16:43:01 +02:00
Thomas Haller
d407727f61 libnm: fix backported autoconnect-slaves symbols in libnm.ver
On master, we added new symbols
  nm_setting_connection_autoconnect_slaves_get_type()
  nm_setting_connection_get_autoconnect_slaves()
in the libnm_1_2_0 section.

It is wrong to extend the linker section of a stable
release. When backporting the patch we must create a
new linker section.

Move the symbols to the libnm_1_0_4 section. Note that
master (1.1) also defines the symbol there, so that the
upgrade path works.

https://bugzilla.gnome.org/show_bug.cgi?id=751535

Fixes: 408b631673
2015-06-26 16:33:34 +02:00
Thomas Haller
56317613bd build: add NM_AVAILABLE_IN_1_0_4 define 2015-06-26 16:33:34 +02:00
Thomas Haller
e4a9698fa3 build: update NM_VERSION_CUR_STABLE and NM_VERSION_NEXT_STABLE 2015-06-26 16:33:34 +02:00
Thomas Haller
58991bea61 build: add NM_VERSION_1_0_2 and NM_VERSION_1_0_4 version defines 2015-06-26 16:33:34 +02:00
Lubomir Rintel
25b53ff7eb linux-platform: don't try to read vlan id from netlink objects without type set
They just don't have the information.

(cherry picked from commit 8a1f4beb65)
2015-06-26 15:53:02 +02:00
Jiří Klimeš
94931d49a5 device: renew DHCP lease for active "ignore-carrier" devices on carrier-on (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
(cherry picked from commit 348452f1e0)
2015-06-26 14:38:08 +02:00
Thomas Haller
a12bc0060f config,dns: merge branch 'th/dns-update-on-sigusr1-rh1062301'
https://bugzilla.redhat.com/show_bug.cgi?id=1062301

(cherry picked from commit 7bf78d9511)
2015-06-26 10:45:25 +02:00
Thomas Haller
2ce2f1f946 dns: rewrite "resolv.conf" on SIGHUP and SIGUSR1
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
(cherry picked from commit 68f1203c7c)
2015-06-26 10:42:37 +02:00
Thomas Haller
c16a9665a3 config: pass signals to nm_config_reload()
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.

(cherry picked from commit caed15e082)
2015-06-26 10:40:47 +02:00
Thomas Haller
85978aff78 platform: fix inverting guint8 value inet6_addr_gen_mode_inv
Fixes: e8e455817b
(cherry picked from commit c2754ede5c)
2015-06-25 20:50:55 +02:00
Thomas Haller
35ea2389be team: fix potential crash if team binary doesn't exist
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: 24a764e831
(cherry picked from commit 4fa01c7dc9)
2015-06-25 20:50:54 +02:00
Thomas Haller
9d0c9733a5 platform/coverity: add workarounds to suppress coverify warnings
(cherry picked from commit cd5b260545)
2015-06-25 20:50:54 +02:00
Thomas Haller
55d2489950 platform/test: minor test fix in "test-nmp-object.c"
(cherry picked from commit 0d8f4bbc45)
2015-06-25 20:50:54 +02:00
Thomas Haller
b0a33247c3 libnm-glib: avoid coverity warning
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 "

(cherry picked from commit c157e3233d)
2015-06-25 20:50:54 +02:00
Beniamino Galvani
2a5eea7e76 device: fix handling of ignore-auto-dns and ignore-auto-routes
Since commit ab6548c621 ("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: ab6548c621
(cherry picked from commit 79630c11e5)
2015-06-25 16:56:01 +02:00
Jiří Klimeš
bfab4d79e6 update NEWS file 2015-06-25 16:22:41 +02:00
Jiří Klimeš
0e00801196 cli: allow multiple devices for 'nmcli device disconnect/delete' (bgo #746097)
Allow disconnecting and deleting multiple interfaces at a time. It is much
more user friendly. TAB and bash completions are supported as well.

https://bugzilla.gnome.org/show_bug.cgi?id=746097

(cherry picked from commit b8a2f42a38)
2015-06-25 16:16:07 +02:00
Jiří Klimeš
a932c75015 cli: fix TAB completion for multiple connections in 'nmcli con down/delete'
(cherry picked from commit f8366c8b1c)
2015-06-25 16:16:07 +02:00
Jiří Klimeš
12a68a523b cli: don't return empty strings in nmc_string_to_arg_array()
and unquote strings in the array if required.

(cherry picked from commit 661ef3cd46)
2015-06-25 16:16:07 +02:00
Jiří Klimeš
a702b550f0 trivial: fix typos in NEWS 2015-06-25 09:56:53 +02:00
Jiří Klimeš
c05350be1a core: return more meaningful error when no device is found for activation
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: 6fc3736c7a

(cherry picked from commit 02989896af)
2015-06-25 09:43:47 +02:00
Lubomir Rintel
f423c9750e release: update NEWS
Let's just add there what do we have do far.
2015-06-25 09:40:07 +02:00