mirror of
https://github.com/ntop/n2n.git
synced 2024-09-20 00:51:10 +02:00
Fix mtu with AES
This avoids fragmentation when possible
This commit is contained in:
parent
6328962752
commit
035b66b1a9
10
edge_utils.c
10
edge_utils.c
|
@ -1266,9 +1266,13 @@ static void send_packet2net(n2n_edge_t * eee,
|
||||||
traceEvent(TRACE_DEBUG, "Encode %u B PACKET [%u B data, %u B overhead] transform %u",
|
traceEvent(TRACE_DEBUG, "Encode %u B PACKET [%u B data, %u B overhead] transform %u",
|
||||||
(u_int)idx, (u_int)len, (u_int)(idx-len), tx_transop_idx);
|
(u_int)idx, (u_int)len, (u_int)(idx-len), tx_transop_idx);
|
||||||
|
|
||||||
#if 0
|
#ifdef MTU_ASSERT_VALUE
|
||||||
// MTU assertion to avoid fragmentation
|
{
|
||||||
assert(idx <= 1500);
|
const u_int eth_udp_overhead = 14 + 20 + 8;
|
||||||
|
|
||||||
|
// MTU assertion which avoids fragmentation by N2N
|
||||||
|
assert(idx + eth_udp_overhead <= MTU_ASSERT_VALUE);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
eee->transop.tx_cnt++; /* stats */
|
eee->transop.tx_cnt++; /* stats */
|
||||||
|
|
5
n2n.h
5
n2n.h
|
@ -164,7 +164,10 @@ typedef struct tuntap_dev {
|
||||||
* same value if they are to understand each other. */
|
* same value if they are to understand each other. */
|
||||||
#define N2N_COMPRESSION_ENABLED 1
|
#define N2N_COMPRESSION_ENABLED 1
|
||||||
|
|
||||||
#define DEFAULT_MTU 1400
|
#define DEFAULT_MTU 1390
|
||||||
|
|
||||||
|
/** Uncomment this to enable the MTU check */
|
||||||
|
//#define MTU_ASSERT_VALUE 1500
|
||||||
|
|
||||||
/** Common type used to hold stringified IP addresses. */
|
/** Common type used to hold stringified IP addresses. */
|
||||||
typedef char ipstr_t[32];
|
typedef char ipstr_t[32];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user