Change default MTU to 2800
This commit is contained in:
@@ -223,7 +223,7 @@ std::vector<InetAddress> VirtualTap::ips() const
|
|||||||
void VirtualTap::put(const MAC &from,const MAC &to,unsigned int etherType,
|
void VirtualTap::put(const MAC &from,const MAC &to,unsigned int etherType,
|
||||||
const void *data,unsigned int len)
|
const void *data,unsigned int len)
|
||||||
{
|
{
|
||||||
if (len <= _mtu && _enabled) {
|
if (len && _enabled) {
|
||||||
_lwip_eth_rx(this, from, to, etherType, data, len);
|
_lwip_eth_rx(this, from, to, etherType, data, len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -653,12 +653,13 @@ static err_t _netif_init4(struct netif *n)
|
|||||||
return ERR_IF;
|
return ERR_IF;
|
||||||
}
|
}
|
||||||
// Called from netif code, no need to lock
|
// Called from netif code, no need to lock
|
||||||
|
VirtualTap *tap = (VirtualTap*)(n->state);
|
||||||
n->hwaddr_len = 6;
|
n->hwaddr_len = 6;
|
||||||
n->name[0] = '4';
|
n->name[0] = '4';
|
||||||
n->name[1] = 'a'+netifCount;
|
n->name[1] = 'a'+netifCount;
|
||||||
n->linkoutput = _lwip_eth_tx;
|
n->linkoutput = _lwip_eth_tx;
|
||||||
n->output = etharp_output;
|
n->output = etharp_output;
|
||||||
n->mtu = LWIP_MTU < ZT_MAX_MTU ? LWIP_MTU : ZT_MAX_MTU;
|
n->mtu = std::min(LWIP_MTU,(int)tap->_mtu);
|
||||||
n->flags = NETIF_FLAG_BROADCAST
|
n->flags = NETIF_FLAG_BROADCAST
|
||||||
| NETIF_FLAG_ETHARP
|
| NETIF_FLAG_ETHARP
|
||||||
| NETIF_FLAG_ETHERNET
|
| NETIF_FLAG_ETHERNET
|
||||||
@@ -667,7 +668,6 @@ static err_t _netif_init4(struct netif *n)
|
|||||||
| NETIF_FLAG_LINK_UP
|
| NETIF_FLAG_LINK_UP
|
||||||
| NETIF_FLAG_UP;
|
| NETIF_FLAG_UP;
|
||||||
n->hwaddr_len = sizeof(n->hwaddr);
|
n->hwaddr_len = sizeof(n->hwaddr);
|
||||||
VirtualTap *tap = (VirtualTap*)(n->state);
|
|
||||||
tap->_mac.copyTo(n->hwaddr, n->hwaddr_len);
|
tap->_mac.copyTo(n->hwaddr, n->hwaddr_len);
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
@@ -686,7 +686,7 @@ static err_t _netif_init6(struct netif *n)
|
|||||||
n->name[1] = 'a'+netifCount;
|
n->name[1] = 'a'+netifCount;
|
||||||
n->linkoutput = _lwip_eth_tx;
|
n->linkoutput = _lwip_eth_tx;
|
||||||
n->output_ip6 = ethip6_output;
|
n->output_ip6 = ethip6_output;
|
||||||
n->mtu = LWIP_MTU < ZT_MAX_MTU ? LWIP_MTU : ZT_MAX_MTU;
|
n->mtu = std::min(LWIP_MTU,(int)tap->_mtu);
|
||||||
n->flags = NETIF_FLAG_BROADCAST
|
n->flags = NETIF_FLAG_BROADCAST
|
||||||
| NETIF_FLAG_ETHARP
|
| NETIF_FLAG_ETHARP
|
||||||
| NETIF_FLAG_ETHERNET
|
| NETIF_FLAG_ETHERNET
|
||||||
|
|||||||
@@ -83,7 +83,7 @@
|
|||||||
------------------------------------ Presets -----------------------------------
|
------------------------------------ Presets -----------------------------------
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#define LWIP_MTU 1500
|
#define LWIP_MTU 2800
|
||||||
#define LWIP_CHKSUM_ALGORITHM 2
|
#define LWIP_CHKSUM_ALGORITHM 2
|
||||||
// memory
|
// memory
|
||||||
#define MEMP_NUM_NETCONN 1024
|
#define MEMP_NUM_NETCONN 1024
|
||||||
|
|||||||
Reference in New Issue
Block a user