|
0 |
From 404f23a93198d0b5e81b87d6d55a479838e934cf Mon Sep 17 00:00:00 2001
|
|
1 |
From: Dan Williams <dcbw@redhat.com>
|
|
2 |
Date: Mon, 13 Oct 2014 16:27:20 -0500
|
|
3 |
Subject: [PATCH 1/2] core: don't override external route metrics (bgo #738268)
|
|
4 |
|
|
5 |
A generated connection contains a copy of the device's existing
|
|
6 |
configuration, so it's entirely redundant to merge the connection
|
|
7 |
back into the device's IP config. But even though that should
|
|
8 |
result in no changes to the IP config, NMSettingIPxConfig treats a
|
|
9 |
route metric of '0' as the device priority, while NMIPxConfig
|
|
10 |
allows 0 as a valid route metric. Since the setting values
|
|
11 |
are preferred (they are supposed to be user-supplied and thus
|
|
12 |
override anythign else, but in this case they are generated and
|
|
13 |
thus not user-supplied) external routes with a metric of 0 are
|
|
14 |
overwritten with the device priority metric.
|
|
15 |
|
|
16 |
https://bugzilla.gnome.org/show_bug.cgi?id=738268
|
|
17 |
(cherry picked from commit 8283672451d0b07655a8423af0e17fd26c07a0d1)
|
|
18 |
---
|
|
19 |
src/devices/nm-device.c | 16 ++++++++++++----
|
|
20 |
1 file changed, 12 insertions(+), 4 deletions(-)
|
|
21 |
|
|
22 |
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
|
|
23 |
index 4788a60..05f0e7b 100644
|
|
24 |
--- a/src/devices/nm-device.c
|
|
25 |
+++ b/src/devices/nm-device.c
|
|
26 |
@@ -2635,9 +2635,13 @@ ip4_config_merge_and_apply (NMDevice *self,
|
|
27 |
if (priv->ext_ip4_config)
|
|
28 |
nm_ip4_config_merge (composite, priv->ext_ip4_config);
|
|
29 |
|
|
30 |
- /* Merge user overrides into the composite config */
|
|
31 |
+ /* Merge user overrides into the composite config. Generated+assumed
|
|
32 |
+ * connections come from the system not the user and merging them would
|
|
33 |
+ * be redundant, so don't bother.
|
|
34 |
+ */
|
|
35 |
connection = nm_device_get_connection (self);
|
|
36 |
- if (connection) {
|
|
37 |
+ if ( connection
|
|
38 |
+ && !nm_settings_connection_get_nm_generated (NM_SETTINGS_CONNECTION (connection))) {
|
|
39 |
nm_ip4_config_merge_setting (composite,
|
|
40 |
nm_connection_get_setting_ip4_config (connection),
|
|
41 |
nm_device_get_priority (self));
|
|
42 |
@@ -3080,9 +3084,13 @@ ip6_config_merge_and_apply (NMDevice *self,
|
|
43 |
if (priv->ext_ip6_config)
|
|
44 |
nm_ip6_config_merge (composite, priv->ext_ip6_config);
|
|
45 |
|
|
46 |
- /* Merge user overrides into the composite config */
|
|
47 |
+ /* Merge user overrides into the composite config. Generated+assumed
|
|
48 |
+ * connections come from the system not the user and merging them would
|
|
49 |
+ * be redundant, so don't bother.
|
|
50 |
+ */
|
|
51 |
connection = nm_device_get_connection (self);
|
|
52 |
- if (connection) {
|
|
53 |
+ if ( connection
|
|
54 |
+ && !nm_settings_connection_get_nm_generated (NM_SETTINGS_CONNECTION (connection))) {
|
|
55 |
nm_ip6_config_merge_setting (composite,
|
|
56 |
nm_connection_get_setting_ip6_config (connection),
|
|
57 |
nm_device_get_priority (self));
|
|
58 |
--
|
|
59 |
2.1.4
|
|
60 |
|