Commit 6c1d57b1 authored by Olivier Crête's avatar Olivier Crête

pseudotcp: Separate default and maximum MTU

Accept packets much beyond the default MTU
parent f379241c
......@@ -120,7 +120,8 @@ const guint16 PACKET_MAXIMUMS[] = {
};
// FIXME: This is a reasonable MTU, but we should get it from the lower layer
#define MAX_PACKET 1400
#define DEF_MTU 1300
#define MAX_PACKET 65532
// Note: we removed lowest level because packet overhead was larger!
#define MIN_PACKET 296
......@@ -1087,7 +1088,7 @@ pseudo_tcp_socket_init (PseudoTcpSocket *obj)
priv->msslevel = 0;
priv->largest = 0;
priv->mss = MIN_PACKET - PACKET_OVERHEAD;
priv->mtu_advise = MAX_PACKET;
priv->mtu_advise = DEF_MTU;
priv->rto_base = 0;
......@@ -1629,9 +1630,11 @@ pseudo_tcp_socket_notify_packet(PseudoTcpSocket *self,
if (len > MAX_PACKET) {
//LOG_F(WARNING) << "packet too large";
set_error (EMSGSIZE);
return FALSE;
} else if (len < HEADER_SIZE) {
//LOG_F(WARNING) << "packet too small";
set_error (EINVAL);
return FALSE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment