mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 03:37:49 +02:00
detect MTU for some known ipv6 tunnel brokers
This commit is contained in:
parent
14a6947b02
commit
014e4b0e1d
3 changed files with 24 additions and 3 deletions
|
@ -12,6 +12,7 @@
|
|||
|
||||
#include "util.h"
|
||||
#include "Log.h"
|
||||
#include "I2PEndian.h"
|
||||
|
||||
#if not defined (__FreeBSD__)
|
||||
#include <pthread.h>
|
||||
|
@ -423,6 +424,25 @@ namespace net
|
|||
#endif
|
||||
}
|
||||
|
||||
int GetMaxMTU (const boost::asio::ip::address_v6& localAddress)
|
||||
{
|
||||
uint32_t prefix = bufbe32toh (localAddress.to_bytes ().data ());
|
||||
switch (prefix)
|
||||
{
|
||||
case 0x20010470:
|
||||
case 0x260070ff:
|
||||
// Hurricane Electric
|
||||
return 1480;
|
||||
break;
|
||||
case 0x2a06a004:
|
||||
// route48
|
||||
return 1420;
|
||||
break;
|
||||
default: ;
|
||||
}
|
||||
return 1500;
|
||||
}
|
||||
|
||||
static bool IsYggdrasilAddress (const uint8_t addr[16])
|
||||
{
|
||||
return addr[0] == 0x02 || addr[0] == 0x03;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue