From ffc43f9c4b4ef9988ae1172548d4b3e2cb90ca35 Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Wed, 5 Aug 2020 13:44:18 -0600 Subject: [PATCH] resolve GCC 10 compilation issues --- config.c | 2 ++ ip.c | 3 ++- ipip.h | 18 +++++++++--------- main.c | 9 ++++++--- route.c | 2 ++ 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/config.c b/config.c index af350b3..7388c11 100644 --- a/config.c +++ b/config.c @@ -21,6 +21,8 @@ static void cerr(); /* General error printer */ static void init_config(); static void c_interface(); static void print_config(); +struct interface ifs[MAX_IFACES]; +int ifs_top; static int clineno; static int cerrflag; diff --git a/ip.c b/ip.c index d38b99b..20eec61 100644 --- a/ip.c +++ b/ip.c @@ -90,7 +90,8 @@ struct interface *ifp; struct message *m; { unsigned char buf[MAX_SIZE], *p; - int n, hdr_len, fromlen; + int n, hdr_len; + unsigned int fromlen; #ifdef LINUX struct iphdr *ipptr; #else diff --git a/ipip.h b/ipip.h index 9384c4b..fed254a 100644 --- a/ipip.h +++ b/ipip.h @@ -48,11 +48,11 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -int debugd; -int debugt; -char progname[32]; -int no_timestamp; -int stat_interval; +extern int debugd; +extern int debugt; +extern char progname[]; +extern int no_timestamp; +extern int stat_interval; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -122,14 +122,14 @@ struct route { /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifdef LINUX -struct ipip_route rts[MAX_ROUTES]; +extern struct ipip_route rts[MAX_ROUTES]; #else struct route rts[MAX_ROUTES]; #endif -int rts_top; +extern int rts_top; -struct interface ifs[MAX_IFACES]; -int ifs_top; +extern struct interface ifs[MAX_IFACES]; +extern int ifs_top; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* diff --git a/main.c b/main.c index 049120c..ed9e144 100644 --- a/main.c +++ b/main.c @@ -32,17 +32,21 @@ jmp_buf restart_env; static void hupper(int sig); jmp_buf term_env; static void terminator(); +int stat_interval; +int no_timestamp; +int debugd; +int debugt; +char progname[32]; char *configfile, *routefile; int version_only; -void +int main(argc, argv) int argc; char *argv[]; { int n, i, oops, help; - time_t now; FILE *pid_file; debugd = 0; @@ -139,7 +143,6 @@ main(argc, argv) if(setjmp(term_env)!=0){ send_stats(1); /* force print of statistics */ - now = time(NULL); syslog(LOG_CRIT, "exit (killed)"); exit(0); } diff --git a/route.c b/route.c index 5c8559b..df16e48 100644 --- a/route.c +++ b/route.c @@ -31,6 +31,8 @@ static void sort_routes(); static int rlineno; static int rerrflag; +int rts_top; +struct ipip_route rts[MAX_ROUTES]; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -- 2.30.2