Compare commits
8 Commits
v0.0.82-mu
...
v0.0.85-mu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2cb24c0523 | ||
|
|
65be22202c | ||
|
|
6cc32bafd9 | ||
|
|
6c268e658f | ||
|
|
33e24632d0 | ||
|
|
e1b4c6aafc | ||
|
|
09d1932588 | ||
|
|
4988479df4 |
@@ -11,5 +11,8 @@ cd ..
|
||||
[ -x glorytun ] || exit 1
|
||||
|
||||
mkdir -p deploy
|
||||
|
||||
cp glorytun deploy/glorytun-$(cat VERSION)-$(uname -m).debug.bin
|
||||
|
||||
strip -s glorytun
|
||||
mv glorytun deploy/glorytun-$(cat VERSION)-$(uname -m).bin
|
||||
cp glorytun deploy/glorytun-$(cat VERSION)-$(uname -m).bin
|
||||
|
||||
@@ -17,7 +17,6 @@ glorytun_SOURCES = \
|
||||
src/db.c \
|
||||
src/db.h
|
||||
|
||||
glorytun_CFLAGS += -I$(srcdir)/mud
|
||||
glorytun_SOURCES += \
|
||||
mud/mud.h \
|
||||
mud/mud.c
|
||||
|
||||
2
mud
2
mud
Submodule mud updated: 7cc6e7ad72...762b4487bf
4
src/ip.h
4
src/ip.h
@@ -30,7 +30,9 @@ ip_get_common(struct ip_common *ic, const uint8_t *data, size_t size)
|
||||
ic->proto = data[9];
|
||||
ic->hdr_size = (data[0] & 0xF) << 2;
|
||||
ic->size = ((data[2] << 8) | data[3]);
|
||||
return 0;
|
||||
if (ic->size >= 20)
|
||||
return 0;
|
||||
break;
|
||||
case 6:
|
||||
ic->tc = ((data[0] & 0xF) << 4) | (data[1] >> 4);
|
||||
ic->proto = data[6];
|
||||
|
||||
10
src/main.c
10
src/main.c
@@ -18,13 +18,13 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
|
||||
#include "mud.h"
|
||||
#include "../mud/mud.h"
|
||||
|
||||
#ifndef O_CLOEXEC
|
||||
#define O_CLOEXEC 0
|
||||
#endif
|
||||
|
||||
#define GT_MTU(X) ((X) - 28)
|
||||
#define GT_MTU(X) ((X)-28)
|
||||
|
||||
static struct {
|
||||
volatile sig_atomic_t quit;
|
||||
@@ -50,6 +50,7 @@ static struct {
|
||||
.bind = {
|
||||
.port = 5000,
|
||||
},
|
||||
.mtu = 1500,
|
||||
.timeout = 5000,
|
||||
.ipv4 = 1,
|
||||
#ifdef __linux__
|
||||
@@ -386,8 +387,7 @@ main(int argc, char **argv)
|
||||
size_t size = 0;
|
||||
|
||||
while (sizeof(buf) - size >= gt.mtu) {
|
||||
const int r = tun_read(tun_fd, &buf[size],
|
||||
sizeof(buf) - size);
|
||||
const int r = tun_read(tun_fd, &buf[size], sizeof(buf) - size);
|
||||
|
||||
if (r <= 0 || r > gt.mtu)
|
||||
break;
|
||||
@@ -422,7 +422,7 @@ main(int argc, char **argv)
|
||||
tc = ic.tc & 0xFC;
|
||||
}
|
||||
|
||||
if (p == q)
|
||||
if (p >= q)
|
||||
break;
|
||||
|
||||
int r = mud_send(mud, &buf[p], q - p, tc);
|
||||
|
||||
Reference in New Issue
Block a user