Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clamp MSS to the MTU of the source only #68

Open
wants to merge 1 commit into
base: 1.1
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,6 @@ static void clamp_mss(const node_t *source, const node_t *via, vpn_packet_t *pac
if(!source || !via || !(via->options & OPTION_CLAMP_MSS))
return;

uint16_t mtu = source->mtu;
if(via != myself && via->mtu < mtu)
mtu = via->mtu;

/* Find TCP header */
int start = ether_size;
uint16_t type = DATA(packet)[12] << 8 | DATA(packet)[13];
Expand Down Expand Up @@ -163,7 +159,7 @@ static void clamp_mss(const node_t *source, const node_t *via, vpn_packet_t *pac

/* Found it */
uint16_t oldmss = DATA(packet)[start + 22 + i] << 8 | DATA(packet)[start + 23 + i];
uint16_t newmss = mtu - start - 20;
uint16_t newmss = source->mtu - start - 20;
uint16_t csum = DATA(packet)[start + 16] << 8 | DATA(packet)[start + 17];

if(oldmss <= newmss)
Expand Down