From 4d70042a3817a1df7de8a932cefe218c7223f934 Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 19 Dec 2019 22:15:49 +0800 Subject: [PATCH] tune ttl and mtu --- core/c/custom/lwipopts.h | 1 + core/lwip.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/core/c/custom/lwipopts.h b/core/c/custom/lwipopts.h index 8145066..bbf9ef8 100644 --- a/core/c/custom/lwipopts.h +++ b/core/c/custom/lwipopts.h @@ -36,6 +36,7 @@ #define NO_SYS 1 #define LWIP_TIMERS 1 +#define IP_DEFAULT_TTL 64 #define LWIP_ARP 0 #define ARP_QUEUEING 0 #define IP_FORWARD 0 diff --git a/core/lwip.go b/core/lwip.go index 0753f25..0635e03 100644 --- a/core/lwip.go +++ b/core/lwip.go @@ -118,4 +118,7 @@ func init() { // Now the loop interface is just the first element in // `C.netif_list`, i.e. `*C.netif_list`. lwipInit() + + // Set MTU. + C.netif_list.mtu = 1500 }