Browse Source

tun: tun_init_nat always uses TUN_MTU_DEFAULT (1500), ignore ETCP mtu from config

chatgui
Evgeny 3 months ago
parent
commit
c60ba6eaec
  1. 5
      src/tun_if.c

5
src/tun_if.c

@ -223,7 +223,8 @@ fail:
struct tun_if* tun_init_nat(struct UASYNC* ua, const char* ifname, const char* ip_addr_str, int mtu, int test_mode)
{
if (!ua || !ifname || !ip_addr_str) return NULL;
if (mtu <= 0) mtu = TUN_MTU_DEFAULT;
(void)mtu;
int tun_mtu = TUN_MTU_DEFAULT;
struct tun_if* tun = u_calloc(1, sizeof(struct tun_if));
if (!tun) return NULL;
@ -238,7 +239,7 @@ struct tun_if* tun_init_nat(struct UASYNC* ua, const char* ifname, const char* i
snprintf(ip_str, sizeof(ip_str), "%s/32", ip_addr_str);
if (!test_mode) {
if (tun_platform_init(tun, tun->ifname, ip_str, mtu) != 0) {
if (tun_platform_init(tun, tun->ifname, ip_str, tun_mtu) != 0) {
u_free(tun);
return NULL;
}

Loading…
Cancel
Save