summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-mail/mailutils/files/mailutils-3.4-fix-endianness.patch')
-rw-r--r--net-mail/mailutils/files/mailutils-3.4-fix-endianness.patch122
1 files changed, 0 insertions, 122 deletions
diff --git a/net-mail/mailutils/files/mailutils-3.4-fix-endianness.patch b/net-mail/mailutils/files/mailutils-3.4-fix-endianness.patch
deleted file mode 100644
index 0e52fae20c1..00000000000
--- a/net-mail/mailutils/files/mailutils-3.4-fix-endianness.patch
+++ /dev/null
@@ -1,122 +0,0 @@
-From feecde8c46cdb597a76df5e6ef02b854843a8a5c Mon Sep 17 00:00:00 2001
-From: Sergey Poznyakoff <gray@gnu.org>
-Date: Thu, 21 Jun 2018 09:46:43 +0300
-Subject: Fix endianness bug in string to IP conversion
-
-* libmailutils/cidr/fromsa.c (_mu_inaddr_to_bytes)
-(_mu_sockaddr_to_bytes): Fix improper endianness conversion.
-* libmailutils/cidr/tosa.c (mu_cidr_to_sockaddr): Simplify conversion.
----
- libmailutils/cidr/fromsa.c | 45 ++++++++++++++++++++-------------------------
- libmailutils/cidr/tosa.c | 9 ++-------
- 2 files changed, 22 insertions(+), 32 deletions(-)
-
-diff --git a/libmailutils/cidr/fromsa.c b/libmailutils/cidr/fromsa.c
-index f57aadc..39d24fd 100644
---- a/libmailutils/cidr/fromsa.c
-+++ b/libmailutils/cidr/fromsa.c
-@@ -29,55 +29,50 @@
- #include <mailutils/cidr.h>
- #include <mailutils/errno.h>
-
--static void
--uint32_to_bytes (unsigned char *bytes, uint32_t u)
--{
-- int i;
--
-- for (i = 0; i < 4; i++)
-- {
-- bytes[i] = u & 0xff;
-- u >>= 8;
-- }
--}
--
- int
- _mu_inaddr_to_bytes (int af, void *buf, unsigned char *bytes)
- {
-- uint32_t u;
-+ size_t len;
-
- switch (af)
- {
- case AF_INET:
-- memcpy (&u, buf, sizeof u);
-- uint32_to_bytes (bytes, u);
-- return 4;
--
-+ len = 4;
-+ break;
-+
- #ifdef MAILUTILS_IPV6
- case AF_INET6:
-- memcpy (bytes, buf, 16);
-- return 16;
-+ len = 16;
-+ break;
- #endif
-+
-+ default:
-+ len = 0;
- }
-- return 0;
-+ memcpy (bytes, buf, len);
-+ return len;
- }
-
- int
- _mu_sockaddr_to_bytes (unsigned char *bytes, struct sockaddr const *sa)
- {
-+ void *buf;
- switch (sa->sa_family)
- {
- case AF_INET:
-- uint32_to_bytes (bytes, ((struct sockaddr_in*)sa)->sin_addr.s_addr);
-- return 4;
-+ buf = &(((struct sockaddr_in*)sa)->sin_addr.s_addr);
-+ break;
-
- #ifdef MAILUTILS_IPV6
- case AF_INET6:
-- memcpy (bytes, &((struct sockaddr_in6*)sa)->sin6_addr, 16);
-- return 16;
-+ buf = &(((struct sockaddr_in6*)sa)->sin6_addr);
-+ break;
- #endif
-+
-+ default:
-+ return 0;
- }
-- return 0;
-+ return _mu_inaddr_to_bytes (sa->sa_family, buf, bytes);
- }
-
- int
-diff --git a/libmailutils/cidr/tosa.c b/libmailutils/cidr/tosa.c
-index 33715e1..2b372b1 100644
---- a/libmailutils/cidr/tosa.c
-+++ b/libmailutils/cidr/tosa.c
-@@ -42,19 +42,14 @@ mu_cidr_to_sockaddr (struct mu_cidr *cidr, struct sockaddr **psa)
- } addr;
- struct sockaddr *sa;
- int socklen;
-- int i;
--
-+
- memset (&addr, 0, sizeof (addr));
- addr.sa.sa_family = cidr->family;
- switch (cidr->family)
- {
- case AF_INET:
- socklen = sizeof (addr.s_in);
-- for (i = 0; i < cidr->len; i++)
-- {
-- addr.s_in.sin_addr.s_addr <<= 8;
-- addr.s_in.sin_addr.s_addr |= cidr->address[i];
-- }
-+ memcpy (&addr.s_in.sin_addr.s_addr, cidr->address, 4);
- break;
-
- #ifdef MAILUTILS_IPV6
---
-cgit v1.0-41-gc330
-