summaryrefslogtreecommitdiffstats
path: root/network/ettercap/gcc-10.patch
diff options
context:
space:
mode:
Diffstat (limited to 'network/ettercap/gcc-10.patch')
-rw-r--r--network/ettercap/gcc-10.patch77
1 files changed, 77 insertions, 0 deletions
diff --git a/network/ettercap/gcc-10.patch b/network/ettercap/gcc-10.patch
new file mode 100644
index 0000000000..f1ec3beeaf
--- /dev/null
+++ b/network/ettercap/gcc-10.patch
@@ -0,0 +1,77 @@
+From 2168090f5b023573ebea0f83574950401ed5d67b Mon Sep 17 00:00:00 2001
+From: Alexander Koeppe <format_c@online.de>
+Date: Wed, 29 Jan 2020 21:09:31 +0100
+Subject: [PATCH] define EC_PTHREAD_NULL as global heap variable
+
+---
+ include/ec_globals.h | 7 +++++++
+ include/ec_threads.h | 2 +-
+ src/ec_globals.c | 3 +++
+ 3 files changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/include/ec_globals.h b/include/ec_globals.h
+index 5033f5dc0..45e12514c 100644
+--- a/include/ec_globals.h
++++ b/include/ec_globals.h
+@@ -176,6 +176,11 @@ struct wifi_env {
+ size_t wkey_len;
+ };
+
++/* threads structure */
++struct thread_env {
++ pthread_t ec_pthread_null;
++};
++
+ /* the globals container */
+ struct ec_globals {
+ struct ec_conf *conf;
+@@ -191,6 +196,7 @@ struct ec_globals {
+ struct target_env *t1;
+ struct target_env *t2;
+ struct wifi_env *wifi;
++ struct thread_env *thread;
+ LIST_HEAD(, hosts_list) hosts_list;
+ TAILQ_HEAD(gbl_ptail, host_profile) profiles_list_head;
+ struct filter_list *filters;
+@@ -213,6 +219,7 @@ EC_API_EXTERN struct ec_globals *ec_gbls;
+ #define EC_GBL_TARGET1 (EC_GBLS->t1)
+ #define EC_GBL_TARGET2 (EC_GBLS->t2)
+ #define EC_GBL_WIFI (EC_GBLS->wifi)
++#define EC_GBL_THREAD (EC_GBLS->thread)
+ #define EC_GBL_HOSTLIST (EC_GBLS->hosts_list)
+ #define EC_GBL_PROFILES (EC_GBLS->profiles_list_head)
+ #define EC_GBL_FILTERS &(EC_GBLS->filters)
+diff --git a/include/ec_threads.h b/include/ec_threads.h
+index 6cd2c1084..f63f3ee3a 100644
+--- a/include/ec_threads.h
++++ b/include/ec_threads.h
+@@ -12,7 +12,7 @@ struct ec_thread {
+ };
+
+ /* a value to be used to return errors in fuctcions using pthread_t values */
+-pthread_t EC_PTHREAD_NULL;
++#define EC_PTHREAD_NULL EC_GBL_THREAD->ec_pthread_null
+ #define EC_PTHREAD_SELF EC_PTHREAD_NULL
+ #define PTHREAD_ID(id) (*(unsigned long*)&(id))
+
+diff --git a/src/ec_globals.c b/src/ec_globals.c
+index 1bc313c15..e45dba5cf 100644
+--- a/src/ec_globals.c
++++ b/src/ec_globals.c
+@@ -52,6 +52,7 @@ void ec_globals_alloc(void)
+ SAFE_CALLOC(ec_gbls->t1, 1, sizeof(struct target_env));
+ SAFE_CALLOC(ec_gbls->t2, 1, sizeof(struct target_env));
+ SAFE_CALLOC(ec_gbls->wifi, 1, sizeof(struct wifi_env));
++ SAFE_CALLOC(ec_gbls->thread, 1, sizeof(struct thread_env));
+ /* filter list entries are allocated as needed */
+ ec_gbls->filters = NULL;
+
+@@ -72,6 +73,8 @@ void ec_globals_free(void)
+ EC_GBL_FREE(ec_gbls->bridge);
+ EC_GBL_FREE(ec_gbls->sm);
+ EC_GBL_FREE(ec_gbls->filters);
++ EC_GBL_FREE(ec_gbls->wifi);
++ EC_GBL_FREE(ec_gbls->thread);
+
+ free_ip_list(ec_gbls->t1);
+ EC_GBL_FREE(ec_gbls->t1);