Skip to content

Commit

Permalink
Fix linker issue of dublicate definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
bkuebler committed Nov 24, 2023
1 parent 923caf8 commit 543b696
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 11 deletions.
23 changes: 12 additions & 11 deletions include/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,20 @@ struct s_initpeers {
struct s_io_addr * addresses;
int count;
};

// global variables
struct s_io_state iostate;
struct s_p2psec * g_p2psec;
int g_mainloop;
extern struct s_io_state iostate;
extern struct s_p2psec * g_p2psec;
extern int g_mainloop;

struct s_switch_state g_switchstate;
struct s_ndp6_state g_ndpstate;
struct s_virtserv_state g_virtserv;
extern struct s_switch_state g_switchstate;
extern struct s_ndp6_state g_ndpstate;
extern struct s_virtserv_state g_virtserv;

int g_enableconsole;
int g_enableeth;
int g_enablendpcache;
int g_enablevirtserv;
int g_enableengines;
extern int g_enableconsole;
extern int g_enableeth;
extern int g_enablendpcache;
extern int g_enablevirtserv;
extern int g_enableengines;

#endif
1 change: 1 addition & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ meshvpn_SOURCES = \
platform/seccomp.c \
platform/perms.c \
platform/ifconfig.c \
app/globals.c \
app/init.c \
app/loop.c \
app/config.c \
Expand Down
34 changes: 34 additions & 0 deletions src/app/globals.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* MeshVPN - A open source peer-to-peer VPN (forked from PeerVPN)
*
* Copyright (C) 2012-2016 Tobias Volk <[email protected]>
* Copyright (C) 2016 Hideman Developer <[email protected]>
* Copyright (C) 2017 Benjamin Kübler <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

struct s_io_state iostate;
struct s_p2psec * g_p2psec;
int g_mainloop;

struct s_switch_state g_switchstate;
struct s_ndp6_state g_ndpstate;
struct s_virtserv_state g_virtserv;

int g_enableconsole;
int g_enableeth;
int g_enablendpcache;
int g_enablevirtserv;
int g_enableengines;

0 comments on commit 543b696

Please sign in to comment.