Skip to content

Commit

Permalink
Fix incorrect teredo MTU calculation
Browse files Browse the repository at this point in the history
libUTP overestimated maximum payload size for UDP packets, which
resulted in fragmented datagrams on IPv6 links with MTU 1280 (e.g.
teredo, 6to4, etc).
  • Loading branch information
yumkam committed Jan 22, 2013
1 parent a9caf98 commit bace1f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utp_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ uint32 UTP_GetMilliseconds()

#define UDP_IPV4_MTU (ETHERNET_MTU - IPV4_HEADER_SIZE - UDP_HEADER_SIZE - GRE_HEADER_SIZE - PPPOE_HEADER_SIZE - MPPE_HEADER_SIZE - FUDGE_HEADER_SIZE)
#define UDP_IPV6_MTU (ETHERNET_MTU - IPV6_HEADER_SIZE - UDP_HEADER_SIZE - GRE_HEADER_SIZE - PPPOE_HEADER_SIZE - MPPE_HEADER_SIZE - FUDGE_HEADER_SIZE)
#define UDP_TEREDO_MTU (TEREDO_MTU - UDP_HEADER_SIZE)
#define UDP_TEREDO_MTU (TEREDO_MTU - IPV6_HEADER_SIZE - UDP_HEADER_SIZE)

uint16 UTP_GetUDPMTU(const struct sockaddr *remote, socklen_t remotelen)
{
Expand Down

0 comments on commit bace1f9

Please sign in to comment.