stun

simple point to point tunnel
git clone git://git.2f30.org/stun
Log | Files | Refs | README

commit bef958646410654d1d339c02d1b50f682e410ef9
parent f78b4b29ab34a7a1b33ef48d9357ef0fb95c41f5
Author: sin <sin@2f30.org>
Date:   Tue, 22 Mar 2016 14:15:32 +0000

fix ifdefs a bit

Diffstat:
Mstun.c | 12+++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/stun.c b/stun.c @@ -7,7 +7,7 @@ #ifdef __linux__ #include <linux/if_tun.h> #include <bsd/stdlib.h> -#else +#elif __OpenBSD__ #include <net/if_tun.h> #endif #include <netinet/in.h> @@ -32,6 +32,11 @@ #include "arg.h" +#ifdef __linux__ +#undef explicit_bzero +#define explicit_bzero bzero +#endif + #define CHALLENGETIMEO 1000 /* in ms */ #define HDRLEN 2 #define MTU 1440 @@ -164,9 +169,6 @@ dummydec(EVP_CIPHER_CTX *ectx, unsigned char *plaintext, } #ifdef __linux__ -#undef explicit_bzero -#define explicit_bzero bzero /* HACK */ - int opentun(char *tundev) { @@ -216,7 +218,7 @@ readtun(int fd, unsigned char *buf, int len) { return read(fd, buf, len); } -#else /* OpenBSD */ +#elif __OpenBSD__ int opentun(char *tundev) {