summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mail-mta/opensmtpd/files/opensmtpd-5.9.2.201606071034_p1-ipv6-net-pton.patch')
-rw-r--r--mail-mta/opensmtpd/files/opensmtpd-5.9.2.201606071034_p1-ipv6-net-pton.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/mail-mta/opensmtpd/files/opensmtpd-5.9.2.201606071034_p1-ipv6-net-pton.patch b/mail-mta/opensmtpd/files/opensmtpd-5.9.2.201606071034_p1-ipv6-net-pton.patch
new file mode 100644
index 00000000000..9841a7e9945
--- /dev/null
+++ b/mail-mta/opensmtpd/files/opensmtpd-5.9.2.201606071034_p1-ipv6-net-pton.patch
@@ -0,0 +1,50 @@
+From 988cff352d6b3dd5fe3224d7ebce361fca5c0b4f Mon Sep 17 00:00:00 2001
+From: gilles <gilles@poolp.org>
+Date: Wed, 8 Jun 2016 08:23:02 +0200
+Subject: [PATCH] on systems with a broken inet_net_pton() that does not
+ support IPv6, fallback to broken_net_inet_pton_ipv6() when errno ==
+ EAFNOSUPPORT
+
+---
+ smtpd/to.c | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/smtpd/to.c b/smtpd/to.c
+index 4a6a765..4b592be 100644
+--- a/smtpd/to.c
++++ b/smtpd/to.c
+@@ -60,7 +60,7 @@ static int alias_is_filename(struct expandnode *, const char *, size_t);
+ static int alias_is_include(struct expandnode *, const char *, size_t);
+ static int alias_is_error(struct expandnode *, const char *, size_t);
+
+-static int temp_inet_net_pton_ipv6(const char *, void *, size_t);
++static int broken_inet_net_pton_ipv6(const char *, void *, size_t);
+
+ const char *
+ sockaddr_to_text(struct sockaddr *sa)
+@@ -301,8 +301,14 @@ text_to_netaddr(struct netaddr *netaddr, const char *s)
+ } else {
+ bits = inet_net_pton(AF_INET6, s, &ssin6.sin6_addr,
+ sizeof(struct in6_addr));
+- if (bits == -1)
+- return 0;
++ if (bits == -1) {
++ if (errno != EAFNOSUPPORT)
++ return 0;
++ bits = broken_inet_net_pton_ipv6(s, &ssin6.sin6_addr,
++ sizeof(struct in6_addr));
++ if (bits == -1)
++ return 0;
++ }
+ ssin6.sin6_family = AF_INET6;
+ memcpy(&ss, &ssin6, sizeof(ssin6));
+ #ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN
+@@ -896,7 +902,7 @@ alias_is_error(struct expandnode *alias, const char *line, size_t len)
+ }
+
+ static int
+-temp_inet_net_pton_ipv6(const char *src, void *dst, size_t size)
++broken_inet_net_pton_ipv6(const char *src, void *dst, size_t size)
+ {
+ int ret;
+ int bits;