relay: Disable relay_sys when the relay module is disabled

Closes ticket 32245.
This commit is contained in:
teor 2019-11-14 16:27:06 +10:00
parent 88c2a23c4b
commit 0df8bcfb6f
5 changed files with 15 additions and 2 deletions

3
changes/ticket32245 Normal file
View File

@ -0,0 +1,3 @@
o Code simplification and refactoring:
- Disable relay_sys when the relay module is disabled.
Closes ticket 32245.

View File

@ -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,

View File

@ -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.

View File

@ -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) */

View File

@ -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) */