aboutsummaryrefslogtreecommitdiffstats
path: root/main/iputils/net-misc_iputils_files_iputils-20121221-openssl.patch
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2014-04-15 09:53:51 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2014-04-15 10:47:40 +0000
commit886cdb13df9d53858fead63397547357770eb638 (patch)
treee7c16624b276727775cc39c39dc84fdc35134cf5 /main/iputils/net-misc_iputils_files_iputils-20121221-openssl.patch
parent0a7a893f64cb0bddefb5a7ca2593fd95bbf43e7b (diff)
downloadaports-886cdb13df9d53858fead63397547357770eb638.tar.bz2
aports-886cdb13df9d53858fead63397547357770eb638.tar.xz
main/iputils: fixes compilation with musl
Diffstat (limited to 'main/iputils/net-misc_iputils_files_iputils-20121221-openssl.patch')
-rw-r--r--main/iputils/net-misc_iputils_files_iputils-20121221-openssl.patch92
1 files changed, 92 insertions, 0 deletions
diff --git a/main/iputils/net-misc_iputils_files_iputils-20121221-openssl.patch b/main/iputils/net-misc_iputils_files_iputils-20121221-openssl.patch
new file mode 100644
index 0000000000..1c6ba81dab
--- /dev/null
+++ b/main/iputils/net-misc_iputils_files_iputils-20121221-openssl.patch
@@ -0,0 +1,92 @@
+From b57d77dcfa5cb363b7eba5b331324669a8505ac4 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Thu, 24 Jan 2013 23:32:39 -0500
+Subject: [PATCH [iputils]] ping6: allow disabling of openssl support
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ Makefile | 5 ++++-
+ ping6.c | 14 +++++++++++++-
+ 2 files changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 89249f5..2c49940 100644
+--- a/Makefile
++++ b/Makefile
+@@ -36,7 +36,7 @@ ARPING_DEFAULT_DEVICE=
+
+ # GNU TLS library for ping6 [yes|no|static]
+ USE_GNUTLS=yes
+-# Crypto library for ping6 [shared|static]
++# Crypto library for ping6 [shared|static|no]
+ USE_CRYPTO=shared
+ # Resolv library for ping6 [yes|static]
+ USE_RESOLV=yes
+@@ -63,7 +63,10 @@ ifneq ($(USE_GNUTLS),no)
+ LIB_CRYPTO = $(call FUNC_LIB,$(USE_GNUTLS),$(LDFLAG_GNUTLS))
+ DEF_CRYPTO = -DUSE_GNUTLS
+ else
++ifneq ($(USE_CRYPTO),no)
+ LIB_CRYPTO = $(call FUNC_LIB,$(USE_CRYPTO),$(LDFLAG_CRYPTO))
++ DEF_CRYPTO = -DUSE_OPENSSL
++endif
+ endif
+
+ # USE_RESOLV: LIB_RESOLV
+diff --git a/ping6.c b/ping6.c
+index c39864d..f2f90af 100644
+--- a/ping6.c
++++ b/ping6.c
+@@ -168,8 +168,10 @@ static int icmp_sock;
+
+ #ifdef USE_GNUTLS
+ # include <gnutls/openssl.h>
+-#else
++# define USE_CRYPTO
++#elif defined USE_OPENSSL
+ # include <openssl/md5.h>
++# define USE_CRYPTO
+ #endif
+
+ /* Node Information query */
+@@ -326,6 +328,7 @@ static void niquery_init_nonce(void)
+ #if !PING6_NONCE_MEMORY
+ static int niquery_nonce(__u8 *nonce, int fill)
+ {
++# ifdef USE_CRYPTO
+ static __u8 digest[MD5_DIGEST_LENGTH];
+ static int seq = -1;
+
+@@ -348,6 +351,10 @@ static int niquery_nonce(__u8 *nonce, int fill)
+ return -1;
+ return ntohsp((__u16 *)nonce);
+ }
++# else
++ fprintf(stderr, "ping6: function not available; crypto disabled\n");
++ exit(3);
++# endif
+ }
+ #endif
+
+@@ -502,6 +509,7 @@ static int niquery_option_subject_addr_handler(int index, const char *arg)
+
+ static int niquery_option_subject_name_handler(int index, const char *arg)
+ {
++#ifdef USE_CRYPTO
+ static char nigroup_buf[INET6_ADDRSTRLEN + 1 + IFNAMSIZ];
+ unsigned char *dnptrs[2], **dpp, **lastdnptr;
+ int n;
+@@ -627,6 +635,10 @@ errexit:
+ free(idn);
+ free(name);
+ exit(1);
++#else
++ fprintf(stderr, "ping6: function not available; crypto disabled\n");
++ exit(3);
++#endif
+ }
+
+ int niquery_option_help_handler(int index, const char *arg)
+--
+1.8.0.2
+