Update to 1.4.6

This commit is contained in:
Thomas Haller 2017-08-23 18:17:12 +02:00
parent d8840953d1
commit 9c01b35d49
6 changed files with 11 additions and 1882 deletions

1
.gitignore vendored
View File

@ -330,3 +330,4 @@ network-manager-applet-0.8.1.tar.bz2
/NetworkManager-1.4.0.tar.xz
/NetworkManager-1.4.2.tar.xz
/NetworkManager-1.4.4.tar.xz
/NetworkManager-1.4.6.tar.xz

File diff suppressed because it is too large Load Diff

View File

@ -1,331 +0,0 @@
From 8358c6687492ab2ecee484a6c0f9e4120228c02f Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Thu, 16 Feb 2017 21:53:04 +0100
Subject: [PATCH 1/3] ifcfg: ensure ipv4.method is not "disabled" when reading
IP addresses from alias files
When the main ifcfg file contains no IP addresses, the method
will be "disabled". Later, when reading IP addresses for the
aliases, we must ensure that the method is manual.
Otherwise, validation fails with
ip.addresses: this property is not allowed for method=disabled
(cherry picked from commit a8f0d88596d8dd2b807a7b0adee272c4f077dade)
(cherry picked from commit be1daa4580267e448ad93b854da382026ea63281)
(cherry picked from commit faf1ffc5ccd94770250082e88885dcf1f70b43ac)
---
src/settings/plugins/ifcfg-rh/reader.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c
index 825d51e..f8b98d9 100644
--- a/src/settings/plugins/ifcfg-rh/reader.c
+++ b/src/settings/plugins/ifcfg-rh/reader.c
@@ -1294,6 +1294,8 @@ read_aliases (NMSettingIPConfig *s_ip4, const char *filename)
nm_ip_address_set_attribute (addr, "label", g_variant_new_string (device));
if (!nm_setting_ip_config_add_address (s_ip4, addr))
PARSE_WARNING ("duplicate IP4 address in alias file %s", item);
+ if (nm_streq0 (nm_setting_ip_config_get_method (s_ip4), NM_SETTING_IP4_CONFIG_METHOD_DISABLED))
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, NULL);
} else {
PARSE_WARNING ("error reading IP4 address from alias file '%s': %s",
full_path, err ? err->message : "no address");
--
2.9.3
From b927746155e1d639783fd72942fceea8a6d61b29 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Mon, 20 Feb 2017 20:51:45 +0100
Subject: [PATCH 2/3] ifcfg: also read DEFROUTE and GATEWAY from alias files
Also accept DEFROUTE and GATEWAY when they are defined in
alias files -- provided, that they are not yet defined
in the main ifcfg file.
(cherry picked from commit 3cc00dd550fcbd83ec2f1af9eeb83bf5ec921d21)
(cherry picked from commit 4c595997f2037707fcc9800c38a8ee8a6630c0e3)
(cherry picked from commit e391fe98a9cd8b22673040efd0992e194584c36d)
---
src/settings/plugins/ifcfg-rh/reader.c | 47 ++++++++++++++++++----
.../ifcfg-rh/tests/network-scripts/Makefile.am | 2 +
.../ifcfg-rh/tests/network-scripts/ifcfg-aliasem3 | 11 +++++
.../tests/network-scripts/ifcfg-aliasem3:1 | 4 ++
.../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 32 +++++++++++----
5 files changed, 80 insertions(+), 16 deletions(-)
create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-aliasem3
create mode 100644 src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-aliasem3:1
diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c
index f8b98d9..55299f2 100644
--- a/src/settings/plugins/ifcfg-rh/reader.c
+++ b/src/settings/plugins/ifcfg-rh/reader.c
@@ -905,6 +905,7 @@ error:
static NMSetting *
make_ip4_setting (shvarFile *ifcfg,
const char *network_file,
+ gboolean *out_has_defroute,
GError **error)
{
NMSettingIPConfig *s_ip4 = NULL;
@@ -913,13 +914,15 @@ make_ip4_setting (shvarFile *ifcfg,
char *method;
char *dns_options = NULL;
gs_free char *gateway = NULL;
- gint32 i;
+ int i;
shvarFile *network_ifcfg;
shvarFile *route_ifcfg;
- gboolean never_default = FALSE;
+ gboolean never_default;
gint64 timeout;
gint priority;
+ nm_assert (out_has_defroute && !*out_has_defroute);
+
s_ip4 = (NMSettingIPConfig *) nm_setting_ip4_config_new ();
/* First check if DEFROUTE is set for this device; DEFROUTE has the
@@ -927,7 +930,13 @@ make_ip4_setting (shvarFile *ifcfg,
* specified is DEFROUTE=yes which means that this connection can be used
* as a default route
*/
- never_default = !svGetValueBoolean (ifcfg, "DEFROUTE", TRUE);
+ i = svGetValueBoolean (ifcfg, "DEFROUTE", -1);
+ if (i == -1)
+ never_default = FALSE;
+ else {
+ never_default = !i;
+ *out_has_defroute = TRUE;
+ }
/* Then check if GATEWAYDEV; it's global and overrides DEFROUTE */
network_ifcfg = svOpenFile (network_file, NULL);
@@ -1216,7 +1225,7 @@ done:
}
static void
-read_aliases (NMSettingIPConfig *s_ip4, const char *filename)
+read_aliases (NMSettingIPConfig *s_ip4, gboolean read_defroute, const char *filename)
{
GDir *dir;
char *dirname, *base;
@@ -1242,6 +1251,7 @@ read_aliases (NMSettingIPConfig *s_ip4, const char *filename)
gboolean ok;
while ((item = g_dir_read_name (dir))) {
+ gs_free char *gateway = NULL;
char *full_path, *device;
const char *p;
@@ -1288,14 +1298,30 @@ read_aliases (NMSettingIPConfig *s_ip4, const char *filename)
}
addr = NULL;
- ok = read_full_ip4_address (parsed, -1, base_addr, &addr, NULL, &err);
- svCloseFile (parsed);
+ ok = read_full_ip4_address (parsed, -1, base_addr, &addr,
+ read_defroute ? &gateway : NULL,
+ &err);
if (ok) {
nm_ip_address_set_attribute (addr, "label", g_variant_new_string (device));
if (!nm_setting_ip_config_add_address (s_ip4, addr))
PARSE_WARNING ("duplicate IP4 address in alias file %s", item);
if (nm_streq0 (nm_setting_ip_config_get_method (s_ip4), NM_SETTING_IP4_CONFIG_METHOD_DISABLED))
g_object_set (s_ip4, NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL, NULL);
+ if (read_defroute) {
+ int i;
+
+ if (gateway) {
+ g_object_set (s_ip4, NM_SETTING_IP_CONFIG_GATEWAY, gateway, NULL);
+ read_defroute = FALSE;
+ }
+ i = svGetValueBoolean (parsed, "DEFROUTE", -1);
+ if (i != -1) {
+ g_object_set (s_ip4,
+ NM_SETTING_IP_CONFIG_NEVER_DEFAULT, (gboolean) !i,
+ NULL);
+ read_defroute = FALSE;
+ }
+ }
} else {
PARSE_WARNING ("error reading IP4 address from alias file '%s': %s",
full_path, err ? err->message : "no address");
@@ -1303,6 +1329,8 @@ read_aliases (NMSettingIPConfig *s_ip4, const char *filename)
}
nm_ip_address_unref (addr);
+ svCloseFile (parsed);
+
g_free (device);
g_free (full_path);
}
@@ -4976,6 +5004,7 @@ connection_from_file_full (const char *filename,
char *devtype, *bootproto;
NMSetting *s_ip4, *s_ip6, *s_port, *s_dcb = NULL;
const char *ifcfg_name = NULL;
+ gboolean has_ip4_defroute = FALSE;
g_return_val_if_fail (filename != NULL, NULL);
g_return_val_if_fail (out_unhandled && !*out_unhandled, NULL);
@@ -5175,13 +5204,15 @@ connection_from_file_full (const char *filename,
} else
nm_connection_add_setting (connection, s_ip6);
- s_ip4 = make_ip4_setting (parsed, network_file, error);
+ s_ip4 = make_ip4_setting (parsed, network_file, &has_ip4_defroute, error);
if (!s_ip4) {
g_object_unref (connection);
connection = NULL;
goto done;
} else {
- read_aliases (NM_SETTING_IP_CONFIG (s_ip4), filename);
+ read_aliases (NM_SETTING_IP_CONFIG (s_ip4),
+ !has_ip4_defroute && !nm_setting_ip_config_get_gateway (NM_SETTING_IP_CONFIG (s_ip4)),
+ filename);
nm_connection_add_setting (connection, s_ip4);
}
diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am b/src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am
index de9c1ed..0da9320 100644
--- a/src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am
+++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am
@@ -154,6 +154,8 @@ ALIAS_FILES = \
ifcfg-aliasem1:1 \
ifcfg-aliasem2 \
ifcfg-aliasem2:1
+ ifcfg-aliasem3 \
+ ifcfg-aliasem3:1
dist-hook:
@for f in $(ALIAS_FILES); do \
diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-aliasem3 b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-aliasem3
new file mode 100644
index 0000000..b7bdd78
--- /dev/null
+++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-aliasem3
@@ -0,0 +1,11 @@
+TYPE=Ethernet
+DEVICE=aliasem0
+HWADDR=00:11:22:33:44:55
+BOOTPROTO=none
+ONBOOT=yes
+DNS1=4.2.2.1
+DNS2=4.2.2.2
+IPADDR=192.168.1.5
+PREFIX=24
+NETMASK=255.255.255.0
+IPV6INIT=no
diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-aliasem3:1 b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-aliasem3:1
new file mode 100644
index 0000000..5e15187
--- /dev/null
+++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-aliasem3:1
@@ -0,0 +1,4 @@
+DEVICE=aliasem3:1
+IPADDR=192.168.1.6
+DEFROUTE=yes
+GATEWAY=192.168.1.1
diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
index 9ed48be..e1865ac 100644
--- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
+++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c
@@ -1581,24 +1581,38 @@ test_read_802_1x_ttls_eapgtc (void)
}
static void
-test_read_wired_aliases_good (void)
+test_read_wired_aliases_good (gconstpointer test_data)
{
+ const int N = GPOINTER_TO_INT (test_data);
NMConnection *connection;
NMSettingConnection *s_con;
NMSettingIPConfig *s_ip4;
- int expected_num_addresses = 4;
- const char *expected_address[4] = { "192.168.1.5", "192.168.1.6", "192.168.1.9", "192.168.1.99" };
- const char *expected_label[4] = { NULL, "aliasem0:1", "aliasem0:2", "aliasem0:99" };
+ int expected_num_addresses;
+ const char *expected_address_0[] = { "192.168.1.5", "192.168.1.6", "192.168.1.9", "192.168.1.99", NULL };
+ const char *expected_address_3[] = { "192.168.1.5", "192.168.1.6", NULL };
+ const char *expected_label_0[] = { NULL, "aliasem0:1", "aliasem0:2", "aliasem0:99", NULL, };
+ const char *expected_label_3[] = { NULL, "aliasem3:1", NULL, };
+ const char **expected_address;
+ const char **expected_label;
int i, j;
+ char path[256];
- connection = _connection_from_file (TEST_IFCFG_DIR "/network-scripts/ifcfg-aliasem0",
- NULL, TYPE_ETHERNET, NULL);
+ expected_address = N == 0 ? expected_address_0 : expected_address_3;
+ expected_label = N == 0 ? expected_label_0 : expected_label_3;
+ expected_num_addresses = g_strv_length ((char **) expected_address);
+
+ nm_sprintf_buf (path, TEST_IFCFG_DIR "/network-scripts/ifcfg-aliasem%d", N);
+
+ connection = _connection_from_file (path, NULL, TYPE_ETHERNET, NULL);
/* ===== CONNECTION SETTING ===== */
s_con = nm_connection_get_setting_connection (connection);
g_assert (s_con);
- g_assert_cmpstr (nm_setting_connection_get_id (s_con), ==, "System aliasem0");
+ if (N == 0)
+ g_assert_cmpstr (nm_setting_connection_get_id (s_con), ==, "System aliasem0");
+ else
+ g_assert_cmpstr (nm_setting_connection_get_id (s_con), ==, "System aliasem3");
/* ===== IPv4 SETTING ===== */
@@ -1637,6 +1651,7 @@ test_read_wired_aliases_good (void)
}
/* Gateway */
+ g_assert (!nm_setting_ip_config_get_never_default (s_ip4));
g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, "192.168.1.1");
for (i = 0; i < expected_num_addresses; i++)
@@ -8913,7 +8928,8 @@ int main (int argc, char **argv)
g_test_add_func (TPATH "802-1x/subj-matches", test_read_write_802_1X_subj_matches);
g_test_add_func (TPATH "802-1x/ttls-eapgtc", test_read_802_1x_ttls_eapgtc);
- g_test_add_func (TPATH "wired/read/aliases", test_read_wired_aliases_good);
+ g_test_add_data_func (TPATH "wired/read/aliases/good/0", GINT_TO_POINTER (0), test_read_wired_aliases_good);
+ g_test_add_data_func (TPATH "wired/read/aliases/good/3", GINT_TO_POINTER (3), test_read_wired_aliases_good);
g_test_add_func (TPATH "wired/read/aliases/bad1", test_read_wired_aliases_bad_1);
g_test_add_func (TPATH "wired/read/aliases/bad2", test_read_wired_aliases_bad_2);
g_test_add_func (TPATH "wifi/read/open", test_read_wifi_open);
--
2.9.3
From a3d2239b217a073e625a46287352848d6e3fc0f2 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Tue, 21 Feb 2017 00:37:41 +0100
Subject: [PATCH 3/3] build: fix type on Makefile.am
Fixes: 3cc00dd550fcbd83ec2f1af9eeb83bf5ec921d21
(cherry picked from commit e824dd34f0dc1bda10ab4102fc27d90f85c1462a)
(cherry picked from commit 2ebc390734a9eaa65109ee989eed12282306aec7)
(cherry picked from commit 304615f30181a2a0a97878a1c14155426086e9a7)
---
src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am b/src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am
index 0da9320..721806f 100644
--- a/src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am
+++ b/src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile.am
@@ -153,7 +153,7 @@ ALIAS_FILES = \
ifcfg-aliasem1 \
ifcfg-aliasem1:1 \
ifcfg-aliasem2 \
- ifcfg-aliasem2:1
+ ifcfg-aliasem2:1 \
ifcfg-aliasem3 \
ifcfg-aliasem3:1
--
2.9.3

View File

@ -1,92 +0,0 @@
From 022fc2d552c28c403ada6e7995d6ab28a653be5e Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Tue, 10 Jan 2017 20:10:19 +0100
Subject: [PATCH 1/1] sparse: avoid clash with __bitwise and __force from 4.10
linux/types.h
It also used __bitwise and __force. It seems easier to rename
our versions since they are local to this one single header.
Also, undefine them afteerwards, so that we don't pollute the
preprocessor macro namespace.
https://github.com/systemd/systemd/pull/5061
(cherry picked from commit 13b2ac2214cb56264fc1e9b96e4ed4382da2db78)
(cherry picked from commit 2f92d8cee111f136ea81da1d56dad817f39c6f26)
---
src/systemd/src/basic/sparse-endian.h | 47 +++++++++++++++++++----------------
1 file changed, 25 insertions(+), 22 deletions(-)
diff --git a/src/systemd/src/basic/sparse-endian.h b/src/systemd/src/basic/sparse-endian.h
index c913fda..a3573b8 100644
--- a/src/systemd/src/basic/sparse-endian.h
+++ b/src/systemd/src/basic/sparse-endian.h
@@ -26,19 +26,19 @@
#include <stdint.h>
#ifdef __CHECKER__
-#define __bitwise __attribute__((bitwise))
-#define __force __attribute__((force))
+#define __sd_bitwise __attribute__((bitwise))
+#define __sd_force __attribute__((force))
#else
-#define __bitwise
-#define __force
+#define __sd_bitwise
+#define __sd_force
#endif
-typedef uint16_t __bitwise le16_t;
-typedef uint16_t __bitwise be16_t;
-typedef uint32_t __bitwise le32_t;
-typedef uint32_t __bitwise be32_t;
-typedef uint64_t __bitwise le64_t;
-typedef uint64_t __bitwise be64_t;
+typedef uint16_t __sd_bitwise le16_t;
+typedef uint16_t __sd_bitwise be16_t;
+typedef uint32_t __sd_bitwise le32_t;
+typedef uint32_t __sd_bitwise be32_t;
+typedef uint64_t __sd_bitwise le64_t;
+typedef uint64_t __sd_bitwise be64_t;
#undef htobe16
#undef htole16
@@ -69,20 +69,23 @@ typedef uint64_t __bitwise be64_t;
#define bswap_64_on_be(x) __bswap_64(x)
#endif
-static inline le16_t htole16(uint16_t value) { return (le16_t __force) bswap_16_on_be(value); }
-static inline le32_t htole32(uint32_t value) { return (le32_t __force) bswap_32_on_be(value); }
-static inline le64_t htole64(uint64_t value) { return (le64_t __force) bswap_64_on_be(value); }
+static inline le16_t htole16(uint16_t value) { return (le16_t __sd_force) bswap_16_on_be(value); }
+static inline le32_t htole32(uint32_t value) { return (le32_t __sd_force) bswap_32_on_be(value); }
+static inline le64_t htole64(uint64_t value) { return (le64_t __sd_force) bswap_64_on_be(value); }
-static inline be16_t htobe16(uint16_t value) { return (be16_t __force) bswap_16_on_le(value); }
-static inline be32_t htobe32(uint32_t value) { return (be32_t __force) bswap_32_on_le(value); }
-static inline be64_t htobe64(uint64_t value) { return (be64_t __force) bswap_64_on_le(value); }
+static inline be16_t htobe16(uint16_t value) { return (be16_t __sd_force) bswap_16_on_le(value); }
+static inline be32_t htobe32(uint32_t value) { return (be32_t __sd_force) bswap_32_on_le(value); }
+static inline be64_t htobe64(uint64_t value) { return (be64_t __sd_force) bswap_64_on_le(value); }
-static inline uint16_t le16toh(le16_t value) { return bswap_16_on_be((uint16_t __force)value); }
-static inline uint32_t le32toh(le32_t value) { return bswap_32_on_be((uint32_t __force)value); }
-static inline uint64_t le64toh(le64_t value) { return bswap_64_on_be((uint64_t __force)value); }
+static inline uint16_t le16toh(le16_t value) { return bswap_16_on_be((uint16_t __sd_force)value); }
+static inline uint32_t le32toh(le32_t value) { return bswap_32_on_be((uint32_t __sd_force)value); }
+static inline uint64_t le64toh(le64_t value) { return bswap_64_on_be((uint64_t __sd_force)value); }
-static inline uint16_t be16toh(be16_t value) { return bswap_16_on_le((uint16_t __force)value); }
-static inline uint32_t be32toh(be32_t value) { return bswap_32_on_le((uint32_t __force)value); }
-static inline uint64_t be64toh(be64_t value) { return bswap_64_on_le((uint64_t __force)value); }
+static inline uint16_t be16toh(be16_t value) { return bswap_16_on_le((uint16_t __sd_force)value); }
+static inline uint32_t be32toh(be32_t value) { return bswap_32_on_le((uint32_t __sd_force)value); }
+static inline uint64_t be64toh(be64_t value) { return bswap_64_on_le((uint64_t __sd_force)value); }
+
+#undef __sd_bitwise
+#undef __sd_force
#endif /* SPARSE_ENDIAN_H */
--
2.9.3

View File

@ -10,9 +10,9 @@
%global snapshot %{nil}
%global git_sha %{nil}
%global rpm_version 1.4.4
%global real_version 1.4.4
%global release_version 5
%global rpm_version 1.4.6
%global real_version 1.4.6
%global release_version 1
%global epoch_version 1
%global obsoletes_nmver 1:0.9.9.95-1
@ -98,9 +98,7 @@ Source1: NetworkManager.conf
Source2: 00-server.conf
Source3: 20-connectivity-fedora.conf
Patch1: 0001-upstream-patches.patch
Patch2: 0002-ifcfg-alias-parsing.patch
Patch3: 0003-build-fix-for-bitwise-rh1444744.patch
#Patch1: 0001-some-patch.patch
Requires(post): systemd
Requires(preun): systemd
@ -342,9 +340,7 @@ by nm-connection-editor and nm-applet in a non-graphical environment.
%prep
%setup -q -n NetworkManager-%{real_version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
#%patch1 -p1
%build
%if %{with regen_docs}
@ -652,6 +648,10 @@ fi
%endif
%changelog
* Wed Aug 23 2017 Thomas Haller <thaller@redhat.com> - 1:1.4.6-1
- Update to 1.4.6
- fix bug clearing cloned-mac-address setting (rh#1413297)
* Fri May 5 2017 Thomas Haller <thaller@redhat.com> - 1:1.4.4-5
- build: fix build failure due to redefinition of __bitwise (rh#1444744)

View File

@ -1 +1 @@
SHA512 (NetworkManager-1.4.4.tar.xz) = a73e423e88b0e2694a46dc04f492a656d766796aa987b2e4644147a5939a6fdeb22ff5d8b36c723444bc0ab3d8740b80fa82c2f5e07f073998841695978d6e14
SHA512 (NetworkManager-1.4.6.tar.xz) = ee024aa165ad6c5862040447d8995e0ae87fbd4096ad6e0d175880370954ad20fe8cf87fa1760ee95f04187260c716d5dbfa9c630a4065a37890ef079541a65c