diff --git a/SOURCES/0022-rh1112020-crash-reading-bridge-sysctl.patch b/SOURCES/0022-rh1112020-crash-reading-bridge-sysctl.patch new file mode 100644 index 0000000..bf0f500 --- /dev/null +++ b/SOURCES/0022-rh1112020-crash-reading-bridge-sysctl.patch @@ -0,0 +1,54 @@ +From db81083ac2d8feb84d08e1c16ef285243fee7977 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Fri, 6 Jun 2014 18:22:06 +0200 +Subject: [PATCH 1/1] device: don't call strtol() for NULL strings + + #1 0x0000003c47239ea2 in __GI_strtol (nptr=nptr@entry=0x0, endptr=endptr@entry=0x0, base=base@entry=10) at ../stdlib/strtol.c:110 + #2 0x000000000043b896 in update_connection (device=, connection=) at devices/nm-device-bridge.c:308 + #3 0x000000000042ed2f in nm_device_generate_connection (device=device@entry=0xfbb260 [NMDeviceBridge]) at devices/nm-device.c:1644 + #4 0x0000000000481613 in get_existing_connection (device=0xfbb260 [NMDeviceBridge], manager=0xfb2000 [NMManager]) at nm-manager.c:1549 + #5 add_device (self=self@entry=0xfb2000 [NMManager], device=device@entry=0xfbb260 [NMDeviceBridge], generate_con=) + at nm-manager.c:1688 + #6 0x0000000000481f50 in platform_link_added (plink=0x7fffffffdd50, ifindex=695, self=0xfb2000 [NMManager], reason=) + at nm-manager.c:2023 + #7 platform_link_cb (platform=, ifindex=695, plink=0x7fffffffdd50, change_type=, reason=, + user_data=) at nm-manager.c:2038 + +(cherry picked from commit 3ef79ee2492475b213bcdf070a1f7207d4e58b64) +--- + src/devices/nm-device-bridge.c | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c +index 92cc9f2..2e6a393 100644 +--- a/src/devices/nm-device-bridge.c ++++ b/src/devices/nm-device-bridge.c +@@ -300,13 +300,20 @@ update_connection (NMDevice *device, NMConnection *connection) + + for (option = master_options; option->name; option++) { + gs_free char *str = nm_platform_master_get_option (ifindex, option->sysname); +- int value = strtol (str, NULL, 10); ++ int value; + +- /* See comments in set_sysfs_uint() about centiseconds. */ +- if (option->user_hz_compensate) +- value /= 100; ++ if (str) { ++ value = strtol (str, NULL, 10); ++ ++ /* See comments in set_sysfs_uint() about centiseconds. */ ++ if (option->user_hz_compensate) ++ value /= 100; + +- g_object_set (s_bridge, option->name, value, NULL); ++ g_object_set (s_bridge, option->name, value, NULL); ++ } else { ++ nm_log_warn (LOGD_BRIDGE, "(%s): failed to read bridge setting '%s'", ++ nm_device_get_iface (device), option->sysname); ++ } + } + } + +-- +1.9.3 + diff --git a/SOURCES/0023-rh1093231-mtu-fix.patch b/SOURCES/0023-rh1093231-mtu-fix.patch new file mode 100644 index 0000000..6f94579 --- /dev/null +++ b/SOURCES/0023-rh1093231-mtu-fix.patch @@ -0,0 +1,160 @@ +From 0757e33e746f0a203b4a4c5f386307e3a8ed9766 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= +Date: Thu, 17 Apr 2014 11:15:36 +0200 +Subject: [PATCH] core: fix MTU handling while merging/subtracting IP configs + (bgo #721420) +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +https://bugzilla.gnome.org/show_bug.cgi?id=721420 +https://bugzilla.redhat.com/show_bug.cgi?id=1047083 + +Signed-off-by: Jiří Klimeš +--- + src/nm-ip4-config.c | 12 ++++++++++- + src/tests/test-ip4-config.c | 50 ++++++++++++++++++++++++++++++++++++++++++++- + 2 files changed, 60 insertions(+), 2 deletions(-) + +diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c +index 034d2e9..505bc85 100644 +--- a/src/nm-ip4-config.c ++++ b/src/nm-ip4-config.c +@@ -15,7 +15,7 @@ + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * +- * Copyright (C) 2005 - 2013 Red Hat, Inc. ++ * Copyright (C) 2005 - 2014 Red Hat, Inc. + * Copyright (C) 2006 - 2008 Novell, Inc. + */ + +@@ -502,9 +502,14 @@ nm_ip4_config_merge (NMIP4Config *dst, const NMIP4Config *src) + for (i = 0; i < nm_ip4_config_get_num_searches (src); i++) + nm_ip4_config_add_search (dst, nm_ip4_config_get_search (src, i)); + ++ /* MSS */ + if (!nm_ip4_config_get_mss (dst)) + nm_ip4_config_set_mss (dst, nm_ip4_config_get_mss (src)); + ++ /* MTU */ ++ if (!nm_ip4_config_get_mtu (dst)) ++ nm_ip4_config_set_mtu (dst, nm_ip4_config_get_mtu (src)); ++ + /* NIS */ + for (i = 0; i < nm_ip4_config_get_num_nis_servers (src); i++) + nm_ip4_config_add_nis_server (dst, nm_ip4_config_get_nis_server (src, i)); +@@ -611,9 +616,14 @@ nm_ip4_config_subtract (NMIP4Config *dst, const NMIP4Config *src) + } + } + ++ /* MSS */ + if (nm_ip4_config_get_mss (src) == nm_ip4_config_get_mss (dst)) + nm_ip4_config_set_mss (dst, 0); + ++ /* MTU */ ++ if (nm_ip4_config_get_mtu (src) == nm_ip4_config_get_mtu (dst)) ++ nm_ip4_config_set_mtu (dst, 0); ++ + /* NIS */ + for (i = 0; i < nm_ip4_config_get_num_nis_servers (src); i++) { + guint32 src_nis = nm_ip4_config_get_nis_server (src, i); +diff --git a/src/tests/test-ip4-config.c b/src/tests/test-ip4-config.c +index e2d5694..f08ed24 100644 +--- a/src/tests/test-ip4-config.c ++++ b/src/tests/test-ip4-config.c +@@ -14,7 +14,7 @@ + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * +- * Copyright (C) 2013 Red Hat, Inc. ++ * Copyright (C) 2013 - 2014 Red Hat, Inc. + * + */ + +@@ -116,6 +116,8 @@ test_subtract (void) + const char *expected_search = "somewhere.com"; + guint32 expected_nis = addr_to_num ("1.2.3.13"); + guint32 expected_wins = addr_to_num ("2.3.4.5"); ++ guint32 expected_mss = 1400; ++ guint32 expected_mtu = 1492; + + src = build_test_config (); + +@@ -135,6 +137,9 @@ test_subtract (void) + nm_ip4_config_add_nis_server (dst, expected_nis); + nm_ip4_config_add_wins (dst, expected_wins); + ++ nm_ip4_config_set_mss (dst, expected_mss); ++ nm_ip4_config_set_mtu (dst, expected_mtu); ++ + nm_ip4_config_subtract (dst, src); + + /* ensure what's left is what we expect */ +@@ -169,6 +174,9 @@ test_subtract (void) + g_assert_cmpuint (nm_ip4_config_get_num_wins (dst), ==, 1); + g_assert_cmpuint (nm_ip4_config_get_wins (dst, 0), ==, expected_wins); + ++ g_assert_cmpuint (nm_ip4_config_get_mss (dst), ==, expected_mss); ++ g_assert_cmpuint (nm_ip4_config_get_mtu (dst), ==, expected_mtu); ++ + g_object_unref (src); + g_object_unref (dst); + } +@@ -286,6 +294,45 @@ test_add_route_with_source (void) + g_object_unref (a); + } + ++static void ++test_merge_subtract_mss_mtu (void) ++{ ++ NMIP4Config *cfg1, *cfg2, *cfg3; ++ guint32 expected_mss2 = 1400; ++ guint32 expected_mtu2 = 1492; ++ guint32 expected_mss3 = 555; ++ guint32 expected_mtu3 = 666; ++ ++ cfg1 = build_test_config (); ++ cfg2 = build_test_config (); ++ cfg3 = build_test_config (); ++ ++ /* add MSS, MTU to configs to test them */ ++ nm_ip4_config_set_mss (cfg2, expected_mss2); ++ nm_ip4_config_set_mtu (cfg2, expected_mtu2); ++ nm_ip4_config_set_mss (cfg3, expected_mss3); ++ nm_ip4_config_set_mtu (cfg3, expected_mtu3); ++ ++ nm_ip4_config_merge (cfg1, cfg2); ++ /* ensure MSS and MTU are in cfg1 */ ++ g_assert_cmpuint (nm_ip4_config_get_mss (cfg1), ==, expected_mss2); ++ g_assert_cmpuint (nm_ip4_config_get_mtu (cfg1), ==, expected_mtu2); ++ ++ nm_ip4_config_merge (cfg1, cfg3); ++ /* ensure again the same MSS and MTU are in cfg1 */ ++ g_assert_cmpuint (nm_ip4_config_get_mss (cfg1), ==, expected_mss2); ++ g_assert_cmpuint (nm_ip4_config_get_mtu (cfg1), ==, expected_mtu2); ++ ++ nm_ip4_config_subtract (cfg1, cfg2); ++ /* ensure MSS and MTU are zero in cfg1 */ ++ g_assert_cmpuint (nm_ip4_config_get_mss (cfg1), ==, 0); ++ g_assert_cmpuint (nm_ip4_config_get_mtu (cfg1), ==, 0); ++ ++ g_object_unref (cfg1); ++ g_object_unref (cfg2); ++ g_object_unref (cfg3); ++} ++ + /*******************************************/ + + int +@@ -299,6 +346,7 @@ main (int argc, char **argv) + g_test_add_func ("/ip4-config/compare-with-source", test_compare_with_source); + g_test_add_func ("/ip4-config/add-address-with-source", test_add_address_with_source); + g_test_add_func ("/ip4-config/add-route-with-source", test_add_route_with_source); ++ g_test_add_func ("/ip4-config/merge-subtract-mss-mtu", test_merge_subtract_mss_mtu); + + return g_test_run (); + } +-- +1.7.11.7 + diff --git a/SPECS/NetworkManager.spec b/SPECS/NetworkManager.spec index fca4cd0..b6fb473 100644 --- a/SPECS/NetworkManager.spec +++ b/SPECS/NetworkManager.spec @@ -28,7 +28,7 @@ Name: NetworkManager Summary: Network connection manager and user applications Epoch: 1 Version: %{realversion} -Release: 23%{snapshot}%{?git_sha}%{?dist} +Release: 25%{snapshot}%{?git_sha}%{?dist} Group: System Environment/Base License: GPLv2+ URL: http://www.gnome.org/projects/NetworkManager/ @@ -58,6 +58,8 @@ Patch18: rh1103702-tui-ipv6-addr-crash-fix.patch Patch19: rh1103702-tui-ipv6-route-crash-fix.patch Patch20: 0020-rh1103782-firewall-zone-conflict.patch Patch21: 0021-rh1108167-nm-crash-on-device-removal.patch +Patch22: 0022-rh1112020-crash-reading-bridge-sysctl.patch +Patch23: 0023-rh1093231-mtu-fix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -228,6 +230,8 @@ by nm-connection-editor and nm-applet in a non-graphical environment. %patch19 -p1 -b .rh1103702-tui-ipv6-route-crash-fix %patch20 -p1 -b .0020.rh1103782-firewall-zone-conflict.orig %patch21 -p1 -b .0021-rh1108167-nm-crash-on-device-removal.orig +%patch22 -p1 -b .0022-rh1112020-crash-reading-bridge-sysctl.orig +%patch23 -p1 -b .0023-rh1093231-mtu-fix.orig %build @@ -448,6 +452,12 @@ fi %endif %changelog +* Tue Jul 1 2014 Jiří Klimeš - 1:0.9.9.1-25.git20140326 +- core: fix MTU handling while merging/subtracting IP configs (rh #1093231) + +* Mon Jun 23 2014 Thomas Haller - 1:0.9.9.1-24.git20140326 +- core: fix crash on failure of reading bridge sysctl values (rh #1112020) + * Thu Jun 12 2014 Thomas Haller - 1:0.9.9.1-23.git20140326 - core: fix crash on device removal with active connection (rh #1108167)