From a25f285c78d6307d7a65dc543f1e153073693167 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Apr 12 2016 13:04:53 +0000 Subject: add better fix for big endian issue on s390x/ppc64 --- diff --git a/ModemManager-bigendian.patch b/ModemManager-bigendian.patch index fbbbdc8..1aad551 100644 --- a/ModemManager-bigendian.patch +++ b/ModemManager-bigendian.patch @@ -1,42 +1,16 @@ -diff -up ModemManager-1.5.991/plugins/huawei/tests/test-modem-helpers-huawei.c.than ModemManager-1.5.991/plugins/huawei/tests/test-modem-helpers-huawei.c ---- ModemManager-1.5.991/plugins/huawei/tests/test-modem-helpers-huawei.c.than 2016-04-07 08:04:47.226567436 -0400 -+++ ModemManager-1.5.991/plugins/huawei/tests/test-modem-helpers-huawei.c 2016-04-07 10:45:48.832853814 -0400 -@@ -161,6 +161,22 @@ static const DhcpTest dhcp_tests[] = { - { NULL } - }; +diff -up ModemManager-1.5.991/plugins/huawei/mm-modem-helpers-huawei.c.than ModemManager-1.5.991/plugins/huawei/mm-modem-helpers-huawei.c +--- ModemManager-1.5.991/plugins/huawei/mm-modem-helpers-huawei.c.than 2016-04-12 14:03:15.519328232 +0200 ++++ ModemManager-1.5.991/plugins/huawei/mm-modem-helpers-huawei.c 2016-04-12 13:56:58.978491128 +0200 +@@ -190,7 +190,11 @@ match_info_to_ip4_addr (GMatchInfo *matc + if (!bin || bin_len != 4) + goto done; -+static char * checkendian(char *ip) -+{ +- *out_addr = GUINT32_TO_BE (*((guint32 *) bin)); +#if __BYTE_ORDER == __BIG_ENDIAN -+ in_addr_t addr; -+ inet_pton(AF_INET, ip, &addr); -+ addr = -+ ((addr & 0xff000000) >> 24) | -+ ((addr & 0x00ff0000) >> 8) | -+ ((addr & 0x0000ff00) << 8) | -+ ((addr & 0x000000ff) << 24); -+ -+ inet_ntop(AF_INET, &addr, ip, INET_ADDRSTRLEN); ++ *out_addr = GUINT32_TO_LE (*((guint32 *) bin)); ++#else ++ *out_addr = GUINT32_TO_BE (*((guint32 *) bin)); +#endif -+ return ip; -+} -+ - static void - test_dhcp (void) - { -@@ -180,11 +196,11 @@ test_dhcp (void) - &error) == TRUE); - g_assert_no_error (error); - -- g_assert_cmpstr (inet_ntoa (*((struct in_addr *) &addr)), ==, dhcp_tests[i].expected_addr); -+ g_assert_cmpstr (checkendian(inet_ntoa (*((struct in_addr *) &addr))), ==, dhcp_tests[i].expected_addr); - g_assert_cmpint (prefix, ==, dhcp_tests[i].expected_prefix); -- g_assert_cmpstr (inet_ntoa (*((struct in_addr *) &gateway)), ==, dhcp_tests[i].expected_gateway); -- g_assert_cmpstr (inet_ntoa (*((struct in_addr *) &dns1)), ==, dhcp_tests[i].expected_dns1); -- g_assert_cmpstr (inet_ntoa (*((struct in_addr *) &dns2)), ==, dhcp_tests[i].expected_dns2); -+ g_assert_cmpstr (checkendian(inet_ntoa (*((struct in_addr *) &gateway))), ==, dhcp_tests[i].expected_gateway); -+ g_assert_cmpstr (checkendian(inet_ntoa (*((struct in_addr *) &dns1))), ==, dhcp_tests[i].expected_dns1); -+ g_assert_cmpstr (checkendian(inet_ntoa (*((struct in_addr *) &dns2))), ==, dhcp_tests[i].expected_dns2); - } - } + success = TRUE; + done: diff --git a/ModemManager.spec b/ModemManager.spec index 6a96e3a..a5025a9 100644 --- a/ModemManager.spec +++ b/ModemManager.spec @@ -7,7 +7,7 @@ Summary: Mobile broadband modem management service Name: ModemManager Version: 1.6 -Release: 0.2.rc2%{?dist} +Release: 0.3.rc2%{?dist} # # Source from http://freedesktop.org/software/ModemManager/ # @@ -173,6 +173,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_datadir}/vala/vapi/libmm-glib.* %changelog +* Tue Apr 12 2016 Than Ngo - 1.6-0.3.rc2 +- add better fix for big endian issue on s390x/ppc64 + * Thu Apr 07 2016 Than Ngo - 1.6-0.2.rc2 - fix big endian issue on s390x/ppc64