Browse Source

Fix mtu with AES

This avoids fragmentation when possible
pull/169/head
emanuele-f 5 years ago
parent
commit
035b66b1a9
  1. 10
      edge_utils.c
  2. 5
      n2n.h

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",
(u_int)idx, (u_int)len, (u_int)(idx-len), tx_transop_idx);
#if 0
// MTU assertion to avoid fragmentation
assert(idx <= 1500);
#ifdef MTU_ASSERT_VALUE
{
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
eee->transop.tx_cnt++; /* stats */

5
n2n.h

@ -164,7 +164,10 @@ typedef struct tuntap_dev {
* same value if they are to understand each other. */
#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. */
typedef char ipstr_t[32];

Loading…
Cancel
Save