aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-11-14 16:27:06 +1000
committerteor <teor@torproject.org>2019-11-14 16:27:06 +1000
commit0df8bcfb6fc31fabccf480f5a153174360dffc7a (patch)
tree343922cd888724388f7d126db68521e840cf1cf5
parent88c2a23c4b3954b321d2247ca3d66cff68e1912d (diff)
downloadtor-0df8bcfb6fc31fabccf480f5a153174360dffc7a.tar.gz
tor-0df8bcfb6fc31fabccf480f5a153174360dffc7a.zip
relay: Disable relay_sys when the relay module is disabled
Closes ticket 32245.
-rw-r--r--changes/ticket322453
-rw-r--r--src/app/main/subsystem_list.c4
-rw-r--r--src/core/include.am2
-rw-r--r--src/feature/dirauth/dirauth_sys.h4
-rw-r--r--src/feature/relay/relay_sys.h4
5 files changed, 15 insertions, 2 deletions
diff --git a/changes/ticket32245 b/changes/ticket32245
new file mode 100644
index 0000000000..fc79e748b1
--- /dev/null
+++ b/changes/ticket32245
@@ -0,0 +1,3 @@
+ o Code simplification and refactoring:
+ - Disable relay_sys when the relay module is disabled.
+ Closes ticket 32245.
diff --git a/src/app/main/subsystem_list.c b/src/app/main/subsystem_list.c
index 4a40702e70..a343207c1c 100644
--- a/src/app/main/subsystem_list.c
+++ b/src/app/main/subsystem_list.c
@@ -18,7 +18,6 @@
#include "core/or/or_sys.h"
#include "core/or/orconn_event_sys.h"
#include "feature/control/btrack_sys.h"
-#include "feature/relay/relay_sys.h"
#include "lib/compress/compress_sys.h"
#include "lib/crypt_ops/crypto_sys.h"
#include "lib/err/torerr_sys.h"
@@ -33,6 +32,7 @@
#include "lib/evloop/evloop_sys.h"
#include "feature/dirauth/dirauth_sys.h"
+#include "feature/relay/relay_sys.h"
#include <stddef.h>
@@ -66,7 +66,9 @@ const subsys_fns_t *tor_subsystems[] = {
&sys_mainloop,
&sys_or,
+#ifdef HAVE_MODULE_RELAY
&sys_relay,
+#endif
#ifdef HAVE_MODULE_DIRAUTH
&sys_dirauth,
diff --git a/src/core/include.am b/src/core/include.am
index 5cafc41210..868e3c49dd 100644
--- a/src/core/include.am
+++ b/src/core/include.am
@@ -143,7 +143,6 @@ LIBTOR_APP_A_SOURCES = \
src/feature/relay/dns.c \
src/feature/relay/ext_orport.c \
src/feature/relay/onion_queue.c \
- src/feature/relay/relay_sys.c \
src/feature/relay/router.c \
src/feature/relay/routerkeys.c \
src/feature/relay/selftest.c \
@@ -174,6 +173,7 @@ MODULE_RELAY_SOURCES = \
src/feature/relay/routermode.c \
src/feature/relay/relay_config.c \
src/feature/relay/relay_periodic.c \
+ src/feature/relay/relay_sys.c \
src/feature/relay/transport_config.c
# The Directory Authority module.
diff --git a/src/feature/dirauth/dirauth_sys.h b/src/feature/dirauth/dirauth_sys.h
index 2d5a0cb3e7..86c8d8ba3e 100644
--- a/src/feature/dirauth/dirauth_sys.h
+++ b/src/feature/dirauth/dirauth_sys.h
@@ -12,6 +12,10 @@
#ifndef DIRAUTH_SYS_H
#define DIRAUTH_SYS_H
+#ifdef HAVE_MODULE_DIRAUTH
+
extern const struct subsys_fns_t sys_dirauth;
+#endif
+
#endif /* !defined(DIRAUTH_SYS_H) */
diff --git a/src/feature/relay/relay_sys.h b/src/feature/relay/relay_sys.h
index 32e21d90d8..aa387369b5 100644
--- a/src/feature/relay/relay_sys.h
+++ b/src/feature/relay/relay_sys.h
@@ -12,6 +12,10 @@
#ifndef TOR_FEATURE_RELAY_RELAY_SYS_H
#define TOR_FEATURE_RELAY_RELAY_SYS_H
+#ifdef HAVE_MODULE_RELAY
+
extern const struct subsys_fns_t sys_relay;
+#endif
+
#endif /* !defined(TOR_FEATURE_RELAY_RELAY_SYS_H) */