From 50755005e079512fe2b7e490496f2284943c391d Mon Sep 17 00:00:00 2001 From: Luca Date: Sat, 1 Sep 2018 18:13:42 +0200 Subject: [PATCH] Compilation fixes --- Makefile | 6 +++--- edge.c | 9 ++++----- edge_utils.c | 4 ++-- transform_aes.c | 2 -- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 7aa7429..eab8878 100644 --- a/Makefile +++ b/Makefile @@ -16,8 +16,8 @@ N2N_DEFINES= N2N_OBJS_OPT= LIBS_EDGE_OPT= -N2N_OPTION_AES?="yes" -#N2N_OPTION_AES=no +#N2N_OPTION_AES?="yes" +N2N_OPTION_AES=no ifeq ($(N2N_OPTION_AES), "yes") N2N_DEFINES+=-DN2N_HAVE_AES @@ -148,4 +148,4 @@ push: pre_push .PHONY: pre_platforms platforms build pre_push push .SILENT: pre_platforms pre_push -# End Docker builder section \ No newline at end of file +# End Docker builder section diff --git a/edge.c b/edge.c index 86cfb86..bebc5b3 100644 --- a/edge.c +++ b/edge.c @@ -174,9 +174,8 @@ static void help() { /* *************************************************** */ -static int setOption(int optkey, char *optarg, edge_conf_t *ec, n2n_edge_t *eee) { - - //traceEvent(TRACE_NORMAL, "Option %c = %s", optkey, optarg ? optarg : ""); +static int setOption(int optkey, char *optargument, edge_conf_t *ec, n2n_edge_t *eee) { + //traceEvent(TRACE_NORMAL, "Option %c = %s", optkey, optargument ? optargument : ""); switch(optkey) { case'K': @@ -185,7 +184,7 @@ static int setOption(int optkey, char *optarg, edge_conf_t *ec, n2n_edge_t *eee) fprintf(stderr, "Error: -K and -k options are mutually exclusive.\n"); exit(1); } else { - strncpy(eee->keyschedule, optarg, N2N_PATHNAME_MAXLEN-1); + strncpy(eee->keyschedule, optargument, N2N_PATHNAME_MAXLEN-1); /* strncpy does not add NULL if the source has no NULL. */ eee->keyschedule[N2N_PATHNAME_MAXLEN-1] = 0; @@ -199,7 +198,7 @@ static int setOption(int optkey, char *optarg, edge_conf_t *ec, n2n_edge_t *eee) { scan_address(ec->ip_addr, N2N_NETMASK_STR_SIZE, ec->ip_mode, N2N_IF_MODE_SIZE, - optarg); + optargument); break; } diff --git a/edge_utils.c b/edge_utils.c index 85bb206..f5a0d0a 100644 --- a/edge_utils.c +++ b/edge_utils.c @@ -894,7 +894,7 @@ static void readFromMgmtSocket(n2n_edge_t * eee, int * keep_running) { "Statistics for edge\n"); msg_len += snprintf((char *)(udp_buf+msg_len), (N2N_PKT_BUF_SIZE-msg_len), - "uptime %llu\n", + "uptime %lu\n", time(NULL) - eee->start_time); msg_len += snprintf((char *)(udp_buf+msg_len), (N2N_PKT_BUF_SIZE-msg_len), @@ -921,7 +921,7 @@ static void readFromMgmtSocket(n2n_edge_t * eee, int * keep_running) { (unsigned int)peer_list_size(eee->known_peers)); msg_len += snprintf((char *)(udp_buf+msg_len), (N2N_PKT_BUF_SIZE-msg_len), - "last super:%llu(%lld sec ago) p2p:%llu(%lld sec ago)\n", + "last super:%lu (%ld sec ago) p2p:%lu (%ld sec ago)\n", eee->last_sup, (now-eee->last_sup), eee->last_p2p, (now-eee->last_p2p)); traceEvent(TRACE_DEBUG, "mgmt status sending: %s", udp_buf); diff --git a/transform_aes.c b/transform_aes.c index 718cb4e..6f51f75 100644 --- a/transform_aes.c +++ b/transform_aes.c @@ -20,8 +20,6 @@ #include "n2n_transforms.h" #if defined(N2N_HAVE_AES) - - #include "openssl/aes.h" #ifndef _MSC_VER /* Not included in Visual Studio 2008 */