add log for possible ip fragmentation

This commit is contained in:
Max Lv
2015-07-31 16:38:25 +08:00
parent b3911fc84f
commit 7260153439
2 changed files with 8 additions and 10 deletions
+6 -8
View File
@@ -639,10 +639,9 @@ static void remote_recv_cb(EV_P_ ev_io *w, int revents)
goto CLEAN_UP;
}
// Drop large packets > default MTU
if (buf_len > MTU) {
LOGE("[udp] drop large packets, size: %d", (int)buf_len);
goto CLEAN_UP;
// packet size > default MTU
if (verbose && buf_len > MTU) {
LOGE("[udp] possible ip fragment, size: %d", (int)buf_len);
}
#ifdef UDPRELAY_LOCAL
@@ -833,10 +832,9 @@ static void server_recv_cb(EV_P_ ev_io *w, int revents)
#endif
#endif
// Drop large packets > default MTU
if (buf_len > MTU) {
LOGE("[udp] drop large packets, size: %d", (int)buf_len);
goto CLEAN_UP;
// packet size > default MTU
if (verbose && buf_len > MTU) {
LOGE("[udp] possible ip fragment, size: %d", (int)buf_len);
}
/*
+2 -2
View File
@@ -37,9 +37,9 @@
#include "common.h"
#define MAX_UDP_PACKET_SIZE (2 * 1024) // large enough for a typical MTU 1500
#define MAX_UDP_PACKET_SIZE (65507)
#define MTU 1421 // 1492 - 1 - 28 - 2 - 40 = 1421, the default MTU for UDP relay
#define MTU 1397 // 1492 - 1 - 28 - 2 - 64 = 1397, the default MTU for UDP relay
struct server_ctx {
ev_io io;