aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2020-06-24 22:30:58 +0200
committerHans Dedecker <dedeckeh@gmail.com>2020-06-24 22:36:21 +0200
commit751e6ab8e625b7b29d1184c8f28ecd6b2df81fa0 (patch)
tree80a3ffb2172ad1fe9d0ac93d92b3039749f33888 /package/network/services
parentd4dea7efcdc46530d47b2fa33ebc7f6606491d3d (diff)
downloadupstream-751e6ab8e625b7b29d1184c8f28ecd6b2df81fa0.tar.gz
upstream-751e6ab8e625b7b29d1184c8f28ecd6b2df81fa0.tar.bz2
upstream-751e6ab8e625b7b29d1184c8f28ecd6b2df81fa0.zip
dropbear: fix compilation for uClibc
Backport patches which fix compile issue for uClibc-ng : dbrandom.c:174:8: warning: implicit declaration of function 'getrandom'; did you mean 'genrandom'? [-Wimplicit-function-declaration] ret = getrandom(buf, sizeof(buf), GRND_NONBLOCK); ^~~~~~~~~ genrandom dbrandom.c:174:36: error: 'GRND_NONBLOCK' undeclared (first use in this function); did you mean 'SOCK_NONBLOCK'? ret = getrandom(buf, sizeof(buf), GRND_NONBLOCK); ^~~~~~~~~~~~~ SOCK_NONBLOCK Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'package/network/services')
-rw-r--r--package/network/services/dropbear/patches/001-backport_GNU_SOURCE-for-random.patch25
-rw-r--r--package/network/services/dropbear/patches/002-backport-move-GNU_SOURCE-earlier.patch34
2 files changed, 59 insertions, 0 deletions
diff --git a/package/network/services/dropbear/patches/001-backport_GNU_SOURCE-for-random.patch b/package/network/services/dropbear/patches/001-backport_GNU_SOURCE-for-random.patch
new file mode 100644
index 0000000000..d9b13d77dd
--- /dev/null
+++ b/package/network/services/dropbear/patches/001-backport_GNU_SOURCE-for-random.patch
@@ -0,0 +1,25 @@
+From 3f5c106a880a02b21739f2022746e6aa7672474c Mon Sep 17 00:00:00 2001
+From: Matt Johnston <matt@ucc.asn.au>
+Date: Tue, 23 Jun 2020 21:38:46 +0800
+Subject: [PATCH] _GNU_SOURCE for random
+
+---
+ includes.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/includes.h b/includes.h
+index e8c3e18..2789f23 100644
+--- a/includes.h
++++ b/includes.h
+@@ -125,6 +125,8 @@
+ #endif
+
+ #ifdef HAVE_SYS_RANDOM_H
++/* uclibc needs _GNU_SOURCE */
++#define _GNU_SOURCE
+ #include <sys/random.h>
+ #endif
+
+--
+2.25.1
+
diff --git a/package/network/services/dropbear/patches/002-backport-move-GNU_SOURCE-earlier.patch b/package/network/services/dropbear/patches/002-backport-move-GNU_SOURCE-earlier.patch
new file mode 100644
index 0000000000..26454c2829
--- /dev/null
+++ b/package/network/services/dropbear/patches/002-backport-move-GNU_SOURCE-earlier.patch
@@ -0,0 +1,34 @@
+From a7a67585cbc3fe5df85c641618b347a51a943356 Mon Sep 17 00:00:00 2001
+From: Matt Johnston <matt@ucc.asn.au>
+Date: Tue, 23 Jun 2020 22:24:58 +0800
+Subject: [PATCH] move GNU_SOURCE earlier
+
+---
+ includes.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/includes.h b/includes.h
+index 2789f23..884ebf7 100644
+--- a/includes.h
++++ b/includes.h
+@@ -25,6 +25,8 @@
+ #ifndef DROPBEAR_INCLUDES_H_
+ #define DROPBEAR_INCLUDES_H_
+
++/* uclibc needs _GNU_SOURCE, maybe other things? */
++#define _GNU_SOURCE
+
+ #include "options.h"
+ #include "debug.h"
+@@ -125,8 +127,6 @@
+ #endif
+
+ #ifdef HAVE_SYS_RANDOM_H
+-/* uclibc needs _GNU_SOURCE */
+-#define _GNU_SOURCE
+ #include <sys/random.h>
+ #endif
+
+--
+2.25.1
+