Compare commits

..

18 Commits

Author SHA1 Message Date
Adrien Gallouët
84156a9eba Update mud 2016-07-20 15:15:11 +00:00
Adrien Gallouët
b13501b9fb Update mud 2016-07-19 16:53:53 +00:00
Adrien Gallouët
3363e219a7 Update mud 2016-07-15 18:45:36 +00:00
Adrien Gallouët
00ee23b0b6 Allow IPv4 and IPv6 only on Linux 2016-07-15 18:42:28 +00:00
Adrien Gallouët
1286b0f69e Update mud 2016-07-15 17:35:45 +00:00
Adrien Gallouët
fe5bc5454e Add chacha20 option and AES-NI negotiation 2016-07-12 17:01:41 +00:00
Adrien Gallouët
f4e94a9089 Remove -flto for now 2016-07-11 10:24:47 +00:00
Adrien Gallouët
6a7da371e2 Add .build.sh 2016-07-11 09:34:16 +00:00
Adrien Gallouët
4cf5f7a118 Update mud 2016-07-07 14:39:19 +00:00
Adrien Gallouët
35fd01f9ee Update mud 2016-07-06 13:42:30 +00:00
Adrien Gallouët
04aad57789 Update mud 2016-07-05 15:41:32 +00:00
Adrien Gallouët
7a277a8810 Update configure.ac 2016-06-30 09:52:34 +00:00
Adrien Gallouët
b232a101d2 Update mud 2016-06-30 09:41:32 +00:00
Adrien Gallouët
a01dc81500 Don't wait too long when we have data to send 2016-06-27 11:19:16 +00:00
Adrien Gallouët
1db628d84a Update mud 2016-06-24 13:21:02 +00:00
Adrien Gallouët
f11cd34dc4 Update mud 2016-06-22 17:55:18 +00:00
Adrien Gallouët
d0376e3aa5 Update mud 2016-06-22 09:18:34 +00:00
Adrien Gallouët
a7518c0e5a Update mud 2016-06-21 16:51:24 +00:00
4 changed files with 36 additions and 8 deletions

15
.build.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
export CC="gcc -static"
git clone https://github.com/jedisct1/libsodium --depth=1 --branch stable
cd libsodium || exit 1
./autogen.sh && ./configure --enable-minimal --disable-shared --prefix=/usr && make install
cd ..
./autogen.sh && ./configure && make
[ -x glorytun ] || exit 1
mkdir -p deploy
strip -s glorytun
mv glorytun deploy/glorytun-$(cat VERSION)-$(uname -m).bin

View File

@@ -14,8 +14,9 @@ AM_SILENT_RULES([yes])
AM_PROG_CC_C_O AM_PROG_CC_C_O
AC_PROG_CC_C99 AC_PROG_CC_C99
AC_USE_SYSTEM_EXTENSIONS AC_USE_SYSTEM_EXTENSIONS
AC_SEARCH_LIBS([getaddrinfo], [resolv nsl])
AC_SEARCH_LIBS([socket], [socket]) AC_SEARCH_LIBS([socket], [socket])
AC_CHECK_LIB([rt], [clock_gettime])
AC_CHECK_FUNCS([clock_gettime])
PKG_CHECK_MODULES([libsodium], [libsodium >= 1.0.4]) PKG_CHECK_MODULES([libsodium], [libsodium >= 1.0.4])
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile])
AC_OUTPUT AC_OUTPUT

2
mud

Submodule mud updated: 2c4443a823...1fe5190e8a

View File

@@ -252,7 +252,11 @@ int main (int argc, char **argv)
long time_tolerance = 0; long time_tolerance = 0;
int v4 = 1; int v4 = 1;
int v6 = 1; int v6 = 0;
#ifdef __linux__
v6 = 1;
#endif
struct option opts[] = { struct option opts[] = {
{ "host", &host, option_str }, { "host", &host, option_str },
@@ -268,6 +272,7 @@ int main (int argc, char **argv)
{ "time-tolerance", &time_tolerance, option_long }, { "time-tolerance", &time_tolerance, option_long },
{ "v4only", NULL, option_option }, { "v4only", NULL, option_option },
{ "v6only", NULL, option_option }, { "v6only", NULL, option_option },
{ "chacha20", NULL, option_option },
{ "version", NULL, option_option }, { "version", NULL, option_option },
{ NULL }, { NULL },
}; };
@@ -280,13 +285,18 @@ int main (int argc, char **argv)
return 0; return 0;
} }
if (option_is_set(opts, "v4only")) if (option_is_set(opts, "v4only")) {
v4 = 1;
v6 = 0; v6 = 0;
}
if (option_is_set(opts, "v6only")) if (option_is_set(opts, "v6only")) {
v4 = 0; v4 = 0;
v6 = 1;
}
if (!v4 && !v6) { if (option_is_set(opts, "v4only") &&
option_is_set(opts, "v6only")) {
gt_log("v4only and v6only are both set\n"); gt_log("v4only and v6only are both set\n");
return 1; return 1;
} }
@@ -317,7 +327,9 @@ int main (int argc, char **argv)
fd_set_nonblock(tun_fd); fd_set_nonblock(tun_fd);
struct mud *mud = mud_create(bind_port, v4, v6); int chacha = option_is_set(opts, "chacha20");
struct mud *mud = mud_create(bind_port, v4, v6, !chacha);
if (!mud) { if (!mud) {
gt_log("couldn't create mud\n"); gt_log("couldn't create mud\n");
@@ -386,7 +398,7 @@ int main (int argc, char **argv)
.tv_usec = 100000, .tv_usec = 100000,
}; };
if (mud_can_push(mud)) if (mud_can_push(mud) || send_size)
timeout.tv_usec = 1000; timeout.tv_usec = 1000;
if _0_(select(mud_fd+1, &rfds, NULL, NULL, &timeout)==-1) { if _0_(select(mud_fd+1, &rfds, NULL, NULL, &timeout)==-1) {